mav [Mon, 23 Jun 2014 13:14:26 +0000 (13:14 +0000)]
MFC r267232, r267239:
Use atomics to modify numvnodes variable.
This allows to mostly avoid lock usage in getnewvnode_[drop_]reserve(),
that reduces number of global vnode_free_list_mtx mutex acquisitions
from 4 to 2 per NFS request on ZFS, improving SMP scalability.
mav [Mon, 23 Jun 2014 13:11:47 +0000 (13:11 +0000)]
MFC r267228:
Split RPC pool threads into number of smaller semi-isolated groups.
Old design with unified thread pool was good from the point of thread
utilization. But single pool-wide mutex became huge congestion point
for systems with many CPUs. To reduce the congestion create several
thread groups within a pool (one group for every 6 CPUs and 12 threads),
each group with own mutex. Each connection during its registration is
assigned to one of the groups in round-robin fashion. File affinify
code may still move requests between the groups, but otherwise groups
are self-contained.
tuexen [Mon, 23 Jun 2014 08:36:48 +0000 (08:36 +0000)]
MFC r267674:
Honor jails for unbound SCTP sockets when selecting source addresses,
reporting IP-addresses to the peer during the handshake, adding
addresses to the host, reporting the addresses via the sysctl
interface (used by netstat, for example) and reporting the
addresses to the application via socket options.
This issue was reported by Bernd Walter.
marius [Mon, 23 Jun 2014 08:32:45 +0000 (08:32 +0000)]
MFC: r267638
Don't denounce peripherals on system shutdown. Together with r267321
(MFCed to stable/9 in r267777), we're now back to the pre-r228483
level of default verbosity. This in turn again typically allows for
reading information that userland might have printed on the screen
before initiating a halt, but still permits to debug potential device
shutdown problems on system shutdown via CAM_DEBUG etc.
Reviewed by: mav
Sponsored by: Bally Wulff Games & Entertainment GmbH
marius [Mon, 23 Jun 2014 08:28:14 +0000 (08:28 +0000)]
MFC: r267321
Avoid the USB device disconnected and controller shutdown clutter on system
shutdown by putting the former under !rebooting and turning the latter into
debug messages.
Reviewed by: hps
Sponsored by: Bally Wulff Games & Entertainment GmbH
np [Mon, 23 Jun 2014 05:42:52 +0000 (05:42 +0000)]
MFC r267689:
Consider the total number of descriptors available (and not just those
that are ready to be reclaimed) when deciding whether to resume tx after
a stall.
dteske [Fri, 20 Jun 2014 17:57:29 +0000 (17:57 +0000)]
MFC revisions 257795,257817,257819,257937-257938,258264-258265,258267,
258854,259113,259427 (11 revisions; summarized below).
r257795: Replace pkg-tools with pkgng
r257817: Fix cosmetic typos
r257819: Use `pkg -vv' to obtain ABI
r257937: Unbreak the installer
r257938: Remove the env(1) but keep the var
r258264: Kick an unused orphan to the curb ;)
r258265: Improve debugging with f_eval_catch()
r258267: Fix package installation from physical media such as DVD
r258854: Fix PKG_ABI detection after pkg-1.2
r259113: Fix failed attempt to send pkg(8) stderr to /dev/null
r259427: Export 'REPOS_DIR' when selected source medium is cdrom
dim [Sat, 14 Jun 2014 18:48:12 +0000 (18:48 +0000)]
MFC r267335:
In some scenarios, when generating llvm/clang .inc.h files, multiple
source files could be passed to tblgen or clang-tblgen, leading to a
"Too many positional arguments specified" error message. Fix this by
replacing the too-generic ${.ALLSRC} sources with explicit paths.
Reported by: rysto32@gmail.com, rodrigc
Approved by: re (gjb)
delphij [Sat, 14 Jun 2014 00:54:57 +0000 (00:54 +0000)]
MFC r267368:
Apply vendor fixes to the High Point drivers:
- Don't call xpt_free_path() in os_query_remove_device() and
always return TRUE.
- Update os_buildsgl() to support build logical SG table which
will be used by lower RAID module.
- Return CAM_SEL_TIMEOUTstatus for SCSIcommand failed as target
missing.
Many thanks to HighPoint for providing this driver update.
Submitted by: Steve Chang
Reviewed by: mav
Approved by: re (gjb)
emaste [Thu, 12 Jun 2014 17:08:04 +0000 (17:08 +0000)]
MFC r266208: Speed up pmcstat by improving string hash
In one case generating callgraph output from a 24MB system-wide sampling
data file took 17.4 seconds on average. Profiling showed pmcstat
spending a lot of time in strcmp, due to hash collisions.
Replacing the XOR-only hash with FNV-1a reduces the run time for my
test by 40%.
emaste [Thu, 12 Jun 2014 16:33:06 +0000 (16:33 +0000)]
MFC r267109, r267179: Update vt(4) "Terminus BSD Console" font
"Terminus BSD Console" is a derivative of Terminus that is provided
by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the
FreeBSD vt(4) console.
delphij [Thu, 12 Jun 2014 00:15:07 +0000 (00:15 +0000)]
Cumulative update to arc4random(3).
MFC r227519, r227520, r238118, r241046:
r227519 (das)
Sync the style, comments, and variable names of arc4random.c with
OpenBSD's version (r1.22). No functional changes, as verified with
md5.
r227520 (das)
Further reduce diffs with OpenBSD's arc4random. The main functional
change here is to ensure that when a process forks after arc4random
is seeded, the parent and child don't observe the same random sequence.
OpenBSD's fix introduces some additional overhead in the form of a
getpid() call.
The only significant remaining difference between our arc4random and
OpenBSD's is in how we seed the generator in arc4_stir().
r238118 (pjd):
Prefer sysctl to open/read/close for obtaining random data.
This method is more sandbox-friendly and also should be faster as only
one syscall is needed instead of three.
In case of an error fall back to the old method.
r241046 (jilles)
libc: Use O_CLOEXEC for various internal file descriptors.
hselasky [Wed, 11 Jun 2014 06:45:52 +0000 (06:45 +0000)]
MFC r267240:
Resolve a deadlock setting the USB configuration index from userspace
on USB HUBs by moving the code into the USB explore threads. The
deadlock happens because child devices of the USB HUB don't have the
expected reference count when called from outside the explore
thread. Only the HUB device itself, which the IOCTL interface locks,
gets the correct reference count.
marius [Tue, 10 Jun 2014 09:33:58 +0000 (09:33 +0000)]
MFC: r266821 (partial)
- Actually, modules are built correctly when compiled along the kernel as
they then pick up an opt_global.h from KERNBUILDDIR having PAE defined.
Thus, build all modules by default except those which still really are
defective as of r267058.
- Minor style cleanup.
Document some user-settable make variables in ports.7
This is not a comprehensive list, as the variables themselves are spread
out over multiple files, but it is a start.
Add a section to make.conf noting that variables may be set there that
affect ports builds, but refer to ports.7 and elsewhere for the actual
listing; any listing in make.conf.5 would likely become out of date
fairly quickly.
rmacklem [Mon, 9 Jun 2014 13:52:10 +0000 (13:52 +0000)]
MFC: r267191
The new NFS server would not allow a hard link to be
created to a symlink. This restriction (which was
inherited from OpenBSD) is not required by the NFS RFCs.
Since this is allowed by the old NFS server, it is a
POLA violation to not allow it. This patch modifies the
new NFS server to allow this.
Reported by: jhb
Reviewed by: jhb
Approved by: re (kib)
cxgbe(4): Properly account for the freelist buffers used when returning
early from service_iq due to a budget restriction. This fixes a potential
rx hang when using INTx.
nwhitehorn [Sun, 8 Jun 2014 21:21:54 +0000 (21:21 +0000)]
MFC r260913,266895:
Add a new flag to /etc/ttys: onifconsole. This is equivalent to "on" if the
device is an active kernel console and "off" otherwise. This is designed to
allow serial-booting x86 systems to provide a login prompt on the serial line
by default without providing one on all systems by default. Set this flag
on x86 systems for ttyu0.
Comments and suggestions by: grehan, dteske, jilles
Approved by: re (gjb)
Relnotes: yes
emaste [Thu, 5 Jun 2014 15:18:49 +0000 (15:18 +0000)]
MFC r240938, r240942: Avoid INVARIANTS panic destroying an in-use tap(4)
The requirement (implied by the KASSERT in tap_destroy) that the tap is
closed isn't valid; destroy_dev will block in devdrn while other threads
are in d_* functions.
Note: if_tun had the same issue, addressed in SVN revisions r186391,
r186483 and r186497. The use of the condvar there appears to be
redundant with the functionality provided by destroy_dev.
mav [Thu, 5 Jun 2014 05:58:54 +0000 (05:58 +0000)]
MFC r266538:
Make ng_mppc to not disable the node in case of multiple packet loss.
Quite often it can be just packet reorder, and killing link in such case
is inconvenient. Add few sysctl's to control that behavior.
kib [Thu, 5 Jun 2014 01:00:27 +0000 (01:00 +0000)]
MFC r266846:
When usermode loaded non-default segment selector into the %gs,
correctly prepare KGSBASE msr to restore the user descriptor base on
the last swapgs during return to usermode.
mav [Wed, 4 Jun 2014 18:58:32 +0000 (18:58 +0000)]
MFC r239133 (by jimharris):
During TSC synchronization test, use rdtsc() rather than rdtsc32(), to
protect against 32-bit TSC overflow while the sync test is running.
On dual-socket Xeon E5-2600 (SNB) systems with up to 32 threads, there
is non-trivial chance (2-3%) that TSC synchronization test fails due to
32-bit TSC overflow while the synchronization test is running.
jhb [Wed, 4 Jun 2014 18:32:41 +0000 (18:32 +0000)]
MFC 266281:
Clear the data buffer length field when freeing a command structure so that
it doesn't leak through when the command structure is reused for a user
command without a data buffer.
marius [Wed, 4 Jun 2014 15:05:24 +0000 (15:05 +0000)]
MFC: r266793, r266799, r266808
- Fix compilation with PAE support enabled by merging r233362 and, thus,
doing away with the unnecessary uint8_t pointer casting.
physical addresses.
- Nuke the unused softc of emujoy(4).
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.
Sponsored by: Bally Wulff Games & Entertainment GmbH
Approved by: re (gjb)
marius [Wed, 4 Jun 2014 15:04:36 +0000 (15:04 +0000)]
MFC: r266792
Fix DMA handling in radeon_dummy_page_init():
- Based on actual usage and on what Linux does, dummy_page.addr should
contain the physical bus address of the dummy page rather than its
virtual one. As a side-effect, correcting this bug fixes compilation
with PAE support enabled by getting rid of an inappropriate cast.
- Also based on actual usage of dummy_page.addr, theoretically Radeon
devices could do a maximum of 44-bit DMA. In reality, though, it is
more likely that they only support 32-bit DMA, at least that is what
radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0
to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on
amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead,
which the existing 32-bit DMA limits within the drm2 code spelled as
0xFFFFFFFF should also be changed to.
Reviewed by: dumbbell
Approved by: re (gjb)
Sponsored by: Bally Wulff Games & Entertainment GmbH
dchagin [Tue, 3 Jun 2014 08:08:12 +0000 (08:08 +0000)]
MFC r266924:
Glibc was switched to the FUTEX_WAIT_BITSET op and CLOCK_REALTIME
flag has been added instead of FUTEX_WAIT to replace the FUTEX_WAIT
logic which needs to do gettimeofday() calls before the futex syscall
to convert the absolute timeout to a relative timeout.
Before this the CLOCK_MONOTONIC used by the FUTEX_WAIT_BITSET op.
When the FUTEX_CLOCK_REALTIME is specified the timeout is an absolute
time, not a relative time. Rework futex_wait to handle this.
On the side fix the futex leak in error case and remove useless
parentheses.
Properly calculate the timeout for the CLOCK_MONOTONIC case.
dchagin [Mon, 2 Jun 2014 19:28:11 +0000 (19:28 +0000)]
MFC r266782:
In r218101 I have not changed properly the futex syscall definition.
Some Linux futex ops atomically verifies that the futex address uaddr
(uval) contains the value val. Comparing signed uval and unsigned val
may lead to an unexpected result, mostly to a deadlock.
So copyin uaddr to an unsigned int to compare the parameters correctly.
While here change ktr records to print parameters in more readable format.
cxgbe(4): Fix a NULL dereference when the very first call to
get_scatter_segment() in get_fl_payload() fails. While here,
fix the code to adjust fl_bufs_used when a failure occurs for
any other scatter segment.
dim [Wed, 28 May 2014 17:44:37 +0000 (17:44 +0000)]
MFC r266674:
Pull in r209489 from upstream clang trunk (by Akira Hatanaka):
Fix a bug in xmmintrin.h.
The last step of _mm_cvtps_pi16 should use _mm_packs_pi32, which is a function
that reads two __m64 values and packs four 32-bit values into four 16-bit
values.