kib [Wed, 29 Aug 2012 16:00:26 +0000 (16:00 +0000)]
MFC r238374:
Add a test program, written by Stephan Uphoff, which demonstrates the
deadlock due to i/o performed over the buffers backed by file mappings.
kib [Wed, 29 Aug 2012 15:45:58 +0000 (15:45 +0000)]
MFC r238029:
Extend the KPI to lock and unlock f_offset member of struct file. It
now fully encapsulates all accesses to f_offset, and extends f_offset
locking to other consumers that need it, in particular, to lseek() and
variants of getdirentries().
kib [Wed, 29 Aug 2012 15:21:27 +0000 (15:21 +0000)]
MFC r236321:
Add vn_io_fault(), which is a facility to prevent page faults while
filesystems perform copyin/copyout of the file data into the usermode
buffer.
kib [Wed, 29 Aug 2012 15:13:13 +0000 (15:13 +0000)]
MFC r236317:
Add a rangelock implementation, intended to be used to range-locking
the i/o regions of the vnode data space. The implementation is quite
simple-minded, it uses the list of the lock requests, ordered by
arrival time. Each request may be for read or for write. The
implementation is fair FIFO.
issyl0 [Wed, 29 Aug 2012 14:06:58 +0000 (14:06 +0000)]
MFC r238813 from HEAD:
- The ad(4) driver no longer exists in FreeBSD CURRENT or 9, so change
the references to it in gsched(8) to the existing ada(4) driver.
issyl0 [Wed, 29 Aug 2012 13:28:25 +0000 (13:28 +0000)]
MFC r238781, r238919 from HEAD:
r238781:
- Add a new man page containing details of new locale-specific functions
for wctype.h, iswalnum_l(3). Add it and its functions to the Makefile.
r238919:
- Add more locale-specific functions to the relevant man pages and
Makefile:
- lib/libc/locale/islower.3
- lib/libc/locale/ispunct.3
- lib/libc/locale/nl_langinfo.3
- lib/libc/locale/isgraph.3
- lib/libc/locale/isspace.3
bz [Wed, 29 Aug 2012 13:19:27 +0000 (13:19 +0000)]
MFC r238960:
In case of IPsec he have to do delayed checksum calculations before
adding any extension header, or rather before calling into IPsec
processing as we may send the packet and not return to IPv6 output
processing here.
gavin [Wed, 29 Aug 2012 12:46:53 +0000 (12:46 +0000)]
Merge r239037,239050 from head:
Support multiple interface devices. The driver had previously hardcoded
support for only the first port, but the CP2105 can have multiple ports.
Although without this change the the first port mostly worked on multi
port devices, there could still be issues with this arrangement.
Update the man page to reflect support for both ports and the CP2105.
Many thanks to Silicon Labs (www.silabs.com) for providing a CP2105-EK
dev board for testing.
jhb [Wed, 29 Aug 2012 12:34:43 +0000 (12:34 +0000)]
MFC 237338:
Don't return an error if a kld does not contain any modules (e.g. a
kld that only contained a sysctl). The kernel linker allows such
modules, so the boot loader should not reject them.
gavin [Wed, 29 Aug 2012 11:23:20 +0000 (11:23 +0000)]
Merge r238803, r238804 from head:
Add support for more devices to uslcom(4). This commit syncronises the
list of supported devices with the union of:
NetBSD src/sys/dev/usb/uslsa.c 1.18
OpenBSD src/sys/dev/usb/uslcom.c 1.24
Linux source/drivers/usb/serial/cp210x.c HEAD
Remove duplicate JABLOTRON PC60B entry.
Note that some of the devices added here are multi-port devices. The
uslcom(4) driver currently only supports the first port on such devices.
Update the man page to reflect the full list of supported devices.
Remove two caveats from the CAVEATS section, as both listed caveats no
longer apply. Add a caveat about multi-port devices.
Improve descriptions for several devices supported by uslcom(4).
Correct the spelling of the company Telegesis.
Move MpMan to the correct location alphabetically.
jimharris [Wed, 29 Aug 2012 01:04:12 +0000 (01:04 +0000)]
MFC r239591:
Remove unncessary atomic operation when reading process flags in
PMC_PROC_IS_USING_PMCS macro.
Invocations of this macro are not synchronized with setting/clearing
of P_HWPMC flag, so the atomic operation here isn't needed. Removing
the atomic operation provides noticeable improvement (5-6%) on
some scheduler-intensive workloads with HWPMC_HOOKS enabled on an
8C Sandy Bridge Xeon system.
jhb [Tue, 28 Aug 2012 18:44:56 +0000 (18:44 +0000)]
MFC 230782,237274:
Refine the implementation of POSIX_FADV_NOREUSE to perform
POSIX_FADV_DONTNEED requests on the currently accessed portion of the
file on each read(2) or write(2) rather than using direct I/O. This
gives much better performance including read-ahead and write clustering
similar to normal read(2) and write(2) calls.
If subsequent read(2) and write(2) calls are sequential, then the
POSIX_FADV_DONTNEED requests will cover the entire sequentially-accessed
range.
fjoe [Tue, 28 Aug 2012 17:08:47 +0000 (17:08 +0000)]
MFC: r238933
- Change back "d_ofs" to int8_t to not pessimize padding and size of "struct puc_cfg".
- Use "puc_config_moxa" for Moxa boards that need d_ofs greater than 0x7f
dteske [Tue, 28 Aug 2012 15:45:37 +0000 (15:45 +0000)]
MFC r239500:
Fix "unexpected operator" error when passed multi-word first-argument
containing whitespace. Also make other changes to support multi-word
arguments.
dim [Tue, 28 Aug 2012 06:47:21 +0000 (06:47 +0000)]
MFC r239509:
Support the WITH_SHARED_TOOLCHAIN setting that was introduced in r234782
for the clang executable. Build it statically by default, like the gcc
executables, which should improve performance a little bit.
kib [Mon, 27 Aug 2012 20:25:26 +0000 (20:25 +0000)]
MFC r239588:
Provide some compat32 shims for sysctl vfs.conflist. It is required
for getvfsbyname(3) operation when called from 32bit process, and
getvfsbyname(3) is used by recent bsdtar import.
jhb [Mon, 27 Aug 2012 19:55:19 +0000 (19:55 +0000)]
MFC 237646,237656,238020:
- Add a new line to top that provides a brief summary of the ZFS ARC memory
usage on hosts using ZFS. The new line displays the total amount of RAM
used by the ARC along with the size of MFU, MRU, anonymous (in flight),
headers, and other (miscellaneous) sub-categories. The line is not
displayed on systems that are not using ZFS.
- Clarify that the cached file data pages included in the "Wired" count
in top are the BIO-level cached data (i.e. "Buf"), since the previous
phrase was a bit ambiguous with the "Cache" count.
jhb [Mon, 27 Aug 2012 19:37:02 +0000 (19:37 +0000)]
MFC 233040,233198,233870,234183:
Add OFED and the associated options and drivers to x86 LINT builds:
- Fix build with INET6 disabled.
- Fix build of OFED bits with debugging options enabled.
- Fix build on i386.
- Mark 'sdp' as requiring 'inet'.
- Always include "opt_inet.h" and "opt_inet6.h" and modify the IB
driver Makefiles to honor WITH/WITHOUT_INET/INET6/_SUPPORT options
to determine what should be enabled during a module build.
- Fix the mlxen(4) driver and the core IB code to compile without
if INET is disabled (including when both INET and INET6 are disabled).
jimharris [Mon, 27 Aug 2012 15:57:33 +0000 (15:57 +0000)]
MFC r239655:
Fix scsi_da's BIO_DELETE->SCSI_UNMAP translation to use correct local
variable when determining various sizes related to SCSI UNMAP block
descriptor lists.
jimharris [Mon, 27 Aug 2012 15:47:46 +0000 (15:47 +0000)]
MFC r239545, r239665:
Fix/add support for SCSI UNMAP to ATA DSM translation.
This addresses kernel panic observed when sending SCSI UNMAP
commands to SATA disks attached to isci(4).
1) Flesh out callback routines to allocate/free buffers needed for
translating SCSI UNMAP data to ATA DSM data.
2) Add controller-level pool for storing buffers previously allocated
for UNMAP translation, to lessen chance of no buffer available
under memory pressure.
3) Ensure driver properly handles case where buffer pool is empty
and contigmalloc returns NULL.
4) Clear freeze bit in isci_remote_device_release_lun_queue() before
calling xpt_release_devq to ensure that any ccbs which immediately
start during the call to xpt_release_devq() see an accurate picture
of the frozen_lun_mask. This code path is extensively exercised
when tagged read/write commands mix with non-tagged DSM commands.
gavin [Mon, 27 Aug 2012 14:44:40 +0000 (14:44 +0000)]
Merge r238778 from head:
The baud rate on CP1201/2/3 devices can be set in one of two ways:
- The USLCOM_SET_BAUD_DIV command (0x01)
- The USLCOM_SET_BAUD_RATE command (0x13)
Devices based on the CP1204 will only accept the latter command, and ignore
the former. As the latter command works on all chips that this driver
supports, switch to always using it.
A slight confusion here is that the previously used command was incorrectly
named USLCOM_BAUD_RATE - even though we no longer use it, rename it to
USLCOM_SET_BAUD_DIV to closer match the name used in the datasheet.
This change reflects a similar change made in the Linux driver, which was
submitted by preston.fick at silabs.com, and has been tested on all of the
uslcom(4) devices I have to hand.
gavin [Mon, 27 Aug 2012 12:40:40 +0000 (12:40 +0000)]
Merge r238766, r238774 from head:
Update the list of devices supported by uplcom. Although this only adds
one device (support for Motorola cables), this syncronises us with:
OpenBSD src/sys/dev/usb/uplcom.c 1.56
NetBSD src/sys/dev/usb/uplcom.c 1.73
Linux kernel.org HEAD
ache [Sun, 26 Aug 2012 05:20:32 +0000 (05:20 +0000)]
MFC r239477
According to resolvconf.conf(5) manpage and sources, there is no
'nameservers' option which used in examples in resolvconf.conf(5),
it spelled 'name_servers', so fix examples.
bschmidt [Thu, 23 Aug 2012 17:09:52 +0000 (17:09 +0000)]
MFC r231187:
Update the 802.11s IE numbers to represent the latest 802.11 amendment
standard.
This update breaks compatibility with older mesh setups but is necessary as
the previous IDs are used by another amendment leading to unexpected results
when trying to associate with an accesspoint using the affected IDs.
Discussed with: re
Tested by: honestqiao at gmail dot com
pfg [Wed, 22 Aug 2012 20:06:59 +0000 (20:06 +0000)]
MFC r238178, 238624, 238810:
Re-merge a couple of changes from NetBSD libedit.
bin/sh has been taught about el_gets setting the count to -1
on error, so now we can partially revert r238173 to reduce
differences with NetBSD's implementation.
Also fix some warnings to be more in sync with NetBSD.
kib [Wed, 22 Aug 2012 19:53:33 +0000 (19:53 +0000)]
MFC r239301:
Add a sysctl kern.pid_max, which limits the maximum pid the system is
allowed to allocate, and corresponding tunable with the same
name. Note that existing processes with higher pids are left intact.
MFC r239328:
Fix grammar.
MFC r239329:
As a safety measure, disable lowering pid_max too much.
kib [Wed, 22 Aug 2012 19:41:36 +0000 (19:41 +0000)]
MFC r239252:
Add a hackish debugging facility to provide a bit of information about
reason for generated trap. The dump of basic signal information and 8
bytes of the faulting instruction are printed on the controlling
terminal of the process, if the machdep.uprintf_signal syscal is
enabled.
kib [Wed, 22 Aug 2012 19:36:47 +0000 (19:36 +0000)]
MFC r239251:
Real hardware, as opposed to QEMU, does not allow to have a call gate
in long mode which transfers control to 32bit code segment. Unbreak
the lcall $7,$0 implementation on amd64 by putting the 64bit user code
segment' selector into call gate, and execute the 64bit trampoline
which converts the return frame into 32bit format and switches back to
32bit mode for executing int $0x80 trampoline.
kib [Wed, 22 Aug 2012 19:34:02 +0000 (19:34 +0000)]
MFC r239250:
For old mmap syscall, when executing on amd64 or ia64, enforce the
PROT_EXEC if prot is non-zero, process is 32bit and
kern.elf32.i386_read_exec syscal is enabled.
kib [Wed, 22 Aug 2012 19:27:17 +0000 (19:27 +0000)]
MFC r239247:
Adjust the r205536, by allowing a non-zero offset for anonymous
mappings for a.out binaries. Apparently, a.out ld.so from FreeBSD
1.1.5.1 can issue such requests.
mdf [Wed, 22 Aug 2012 17:13:00 +0000 (17:13 +0000)]
MFC r238502:
Fix a bug with memguard(9) on 32-bit architectures without a
VM_KMEM_MAX_SIZE.
The code was not taking into account the size of the kernel_map, which
the kmem_map is allocated from, so it could produce a sub-map size too
large to fit. The simplest solution is to ignore VM_KMEM_MAX entirely
and base the memguard map's size off the kernel_map's size, since this
is always relevant and always smaller.
kib [Wed, 22 Aug 2012 05:36:10 +0000 (05:36 +0000)]
MFC r239125:
Do not apply errata 721 workaround when under hypervisor, since
typical hypervisor does not implement access to the required MSR,
causing #GP on boot.
kib [Wed, 22 Aug 2012 05:30:51 +0000 (05:30 +0000)]
MFC r238984:
fsck_ffs shall accept the configured journal size, and not refuse to
operate on it if journal size is greater then SUJ_MAX. The later
constant is only to select maximal journal size when user did not
specified size explicitely.
kib [Wed, 22 Aug 2012 05:15:21 +0000 (05:15 +0000)]
MFC r239040:
Reduce code duplication and exposure of direct access to struct
vm_page oflags by providing helper function
vm_page_readahead_finish(), which handles completed reads for pages
with indexes other then the requested one, for VOP_GETPAGES().
MFC r239246:
Do not leave invalid pages in the object after the short read for a
network file systems (not only NFS proper). Short reads cause pages
other then the requested one, which were not filled by read response,
to stay invalid.
Change the vm_page_readahead_finish() interface to not take the error
code, but instead to make a decision to free or to (de)activate the
page only by its validity. As result, not requested invalid pages are
freed even if the read RPC indicated success.
dim [Tue, 21 Aug 2012 19:45:48 +0000 (19:45 +0000)]
MFC r239192:
Change a few extern inline functions in libm to static inline, since
they need to refer to static constants, which C99 does not allow for
extern inline functions.
While here, change a comment in e_rem_pio2f.c to mention the correct
number of bits.
Reviewed by: bde
MFC r239195:
Add __always_inline to __ieee754_rem_pio2() and __ieee754_rem_pio2f(),
since some older versions of gcc refuse to inline these otherwise.
dim [Tue, 21 Aug 2012 19:26:49 +0000 (19:26 +0000)]
MFC r239106:
Make sure the compiler knows g_gate_xvlog() and g_gate_xlog() do not
return. This silences a warning from clang 3.2 about uninitialized use
of the variable 'mediasize' in sbin/ggate/shared/ggate.c.
dim [Tue, 21 Aug 2012 19:21:46 +0000 (19:21 +0000)]
MFC r239102:
In sys/dev/cxgbe/firmware/t4fw_interface.h, change the enum
'fw_hdr_intfver' into an anonymous enum, which avoids a clang 3.2
warning about all the enum values being the same value.
lstewart [Tue, 21 Aug 2012 02:17:06 +0000 (02:17 +0000)]
MFC r239346:
The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP
timestamp related stack variables to reference ms directly instead of ticks.
The h_ertt(4) Khelp module relies on TCP timestamp information in order to
calculate its enhanced RTT estimates, but was not updated as part of r231767.
Consequently, h_ertt has not been calculating correct RTT estimates since
r231767 was comitted, which in turn broke all delay-based congestion control
algorithms because they rely on the h_ertt RTT estimates.
Fix the breakage by switching h_ertt to use tcp_ts_getticks() in place of all
previous uses of the ticks variable. This ensures all timestamp related
variables in h_ertt use the same units as the TCP stack and therefore results in
meaningful comparisons and RTT estimate calculations.
kan [Mon, 20 Aug 2012 23:47:24 +0000 (23:47 +0000)]
MFC r239470: Do not call process_nodelete with NULL object pointer.
The place where the function is called can be reached if object loading
and relocation fails too, in which case obj pointer will be NULL. Do not
call process_nodelete then, or crash will follow.
delphij [Mon, 20 Aug 2012 18:26:16 +0000 (18:26 +0000)]
MFC r239169:
RFC 2289 requires all hashes be stored in little endian format before
folding to 64 bits, while SHA1 code is big endian. Therefore, a bswap32
is required before using the value.
Without this change, the implementation does not conform to test vector
found in RFC 2289.