]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
10 years agoMFC r260403 (MFV r260399):
delphij [Tue, 7 Jan 2014 20:04:41 +0000 (20:04 +0000)]
MFC r260403 (MFV r260399):

Apply vendor commits:

197e0ea Fix for TLS record tampering bug.  (CVE-2013-4353).
3462896 For DTLS we might need to retransmit messages from the
previous session so keep a copy of write context in DTLS
retransmission buffers instead of replacing it after
sending CCS.  (CVE-2013-6450).
ca98926 When deciding whether to use TLS 1.2 PRF and record hash
algorithms use the version number in the corresponding
SSL_METHOD structure instead of the SSL structure.  The
SSL structure version is sometimes inaccurate.
Note: OpenSSL 1.0.2 and later effectively do this already.
(CVE-2013-6449).

Security: CVE-2013-4353
Security: CVE-2013-6449
Security: CVE-2013-6450

git-svn-id: svn://svn.freebsd.org/base/stable/10@260404 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260290:
pjd [Tue, 7 Jan 2014 19:46:17 +0000 (19:46 +0000)]
MFC r260290:

Bring back the old size of the kinfo_file structure to preserve ABI.
Keep only one uint64_t spare for further cap_rights_t expension.

Add a comment clarifying that if the size of this structure changes,
a new sysctl MIB has to be allocate for it and the old structure has
to be returned by the old sysctl MIB.

Requested by:   re

git-svn-id: svn://svn.freebsd.org/base/stable/10@260402 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260232:
mjg [Tue, 7 Jan 2014 19:28:10 +0000 (19:28 +0000)]
MFC r260232:
Don't check for fd limits in fdgrowtable_exp.

Callers do that already and additional check races with process
decreasing limits and can result in not growing the table at all, which
is currently not handled.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260400 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259841
pfg [Tue, 7 Jan 2014 18:32:31 +0000 (18:32 +0000)]
MFC r259841

gcc:  Add ability to generate DWARF pubtypes section if
DEBUG_PUBTYPES_SECTION is defined.

Obtained from: gcc 4.3 (rev. 118826; GPLv2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@260395 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
scottl [Tue, 7 Jan 2014 01:51:48 +0000 (01:51 +0000)]
MFC Alexander Motin's direct dispatch, multi-queue, and finer-grained
locking support for CAM

r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

r256836:
Remove hard limit on number of BIOs handled with one ATA TRIM request.

r256843:
Merge CAM locking changes from the projects/camlock branch to radically
reduce lock congestion and improve SMP scalability of the SCSI/ATA stack,
preparing the ground for the coming next GEOM direct dispatch support.

r256888:
Unconditionally acquire periph reference on CCB allocation failure.

r256895:
Fix memory and references leak due to unfreed path.

r256960:
Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock.
This fixes race condition with cam_periph_ccbwait(), causing use-after-free.

r256975:
Minor (mostly cosmetical) addition to r256960.

r257054:
Some microoptimizations for da and ada drivers:
 - Replace ordered_tag_count counter with single flag;
 - From da remove outstanding_cmds counter, duplicating pending_ccbs list;
 - From da_softc remove unused links field.

r257482:
Fix lock recursion, triggered by `smartctl -a /dev/adaX`.

r257501:
Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not
allocate memory and so not require sleepable environment.  getenv() has
already used on-stack temporary storage, so just use it more rationally.
getenv_string() receives buffer as argument, so don't need another one.

r257914:
Some CAM locks polishing:
 - Fix LOR and possible lock recursion when handling high-power commands.
Introduce new lock to protect left power quota and list of frozen devices.
 - Correct locking around xpt periph creation.
 - Remove seems never used XPT_FLAG_OPEN xpt periph flag.

Again, Netflix assisted with testing the merge, but all of the credit goes
to Alexander and iX Systems.

Submitted by: mav
Sponsored by: iX Systems

git-svn-id: svn://svn.freebsd.org/base/stable/10@260387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC Alexander Motin's GEOM direct dispatch work:
scottl [Tue, 7 Jan 2014 01:32:23 +0000 (01:32 +0000)]
MFC Alexander Motin's GEOM direct dispatch work:

r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time.  Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer.  That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

r256880:
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

r259247:
Fix bug introduced at r256607.  We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by:   mav
Sponsored by:   iX Systems

git-svn-id: svn://svn.freebsd.org/base/stable/10@260385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256885:
mav [Sun, 5 Jan 2014 23:02:03 +0000 (23:02 +0000)]
MFC r256885:
Remove global device lock acquisition from dev_relthread(), replacing it
with atomics on per-device data.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256614:
mav [Sun, 5 Jan 2014 23:00:38 +0000 (23:00 +0000)]
MFC r256614:
 - Take BIO lock in biodone() only when there is no completion callback set
and so we should wake up thread waiting in biowait().
 - Remove msleep() timeout from biowait().  It was added 11 years ago, when
there was no locks used, and it should not be needed any more.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260354 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258173:
mav [Sun, 5 Jan 2014 22:55:21 +0000 (22:55 +0000)]
MFC r258173:
Add few more minor parts of DevSleep support from AHCI 1.3.1 proposal.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258169:
mav [Sun, 5 Jan 2014 22:53:55 +0000 (22:53 +0000)]
MFC r258169:
Add ID for Intel Avoton SMBus controller.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258168, r258170:
mav [Sun, 5 Jan 2014 22:52:59 +0000 (22:52 +0000)]
MFC r258168, r258170:
Add some more Intel HDA controller and CODEC IDs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258164:
mav [Sun, 5 Jan 2014 22:51:09 +0000 (22:51 +0000)]
MFC r258164:
Handle case when ACPI reports HPET device, but does not provide memory
resource for it.  In such case take the address range from the HPET table.

This fixes hpet(4) driver attach on Asrock C2750D4I board.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260350 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258162:
mav [Sun, 5 Jan 2014 22:49:54 +0000 (22:49 +0000)]
MFC r258162:
Add some more IDs for Intel ATA, AHCI and USB controllers.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r257932:
mav [Sun, 5 Jan 2014 22:48:12 +0000 (22:48 +0000)]
MFC r257932:
Use relaxed (write-only) memory barriers when writing some of queue index
registers (for now on ISP2400+).  We never read those registers back and
AFAIK their semantics does not require any immediate reaction on write.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260347 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r257930:
mav [Sun, 5 Jan 2014 22:47:12 +0000 (22:47 +0000)]
MFC r257930:
Some more registers access optimizations:
 - Process ATIO queue only if interrupt status tells so;
 - Do not update queue out pointers after each processed command, do it
only once at the end of the loop.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260346 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r257916:
mav [Sun, 5 Jan 2014 22:45:46 +0000 (22:45 +0000)]
MFC r257916:
Save one more register read per command by not reading rqstoutrp register
every time.  The purpose of that register is unlikely output queue overflow
detection, so read it only when its last known (and probably stale now)
value signals overflow.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260345 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256893:
mav [Sun, 5 Jan 2014 22:43:40 +0000 (22:43 +0000)]
MFC r256893:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109815

git-svn-id: svn://svn.freebsd.org/base/stable/10@260344 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256887:
mav [Sun, 5 Jan 2014 22:42:42 +0000 (22:42 +0000)]
MFC r256887:
Fix memory and references leak due to unfreed path.

Coverity CID:   1109817

git-svn-id: svn://svn.freebsd.org/base/stable/10@260343 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256826:
mav [Sun, 5 Jan 2014 22:40:28 +0000 (22:40 +0000)]
MFC r256826:
Fix several target mode SIMs to not blindly clear ccb_h.flags field of
ATIO CCBs.  Not all CCB flags there belong to them.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260342 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256705:
mav [Sun, 5 Jan 2014 22:38:44 +0000 (22:38 +0000)]
MFC r256705:
Optimize isp(4) to reduce CPU usage, especially in target mode:
 - Remove two excessive and slow register reads from isp_intr().  Instead
of rereading value every time, assume that registers contain what we have
written there.
 - Avoid sequential search through 4096 array elements when looking for
command tag.  Use hash of lists to store active tags separately from free
ones and so greatly speedup the searches.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260341 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259168:
mav [Sun, 5 Jan 2014 22:14:12 +0000 (22:14 +0000)]
MFC r259168:
Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE
(64MB).  Even if we would find one somehow, ZFS kernel code rejects such
devices.  It is funny to look on attempts to read 4 256K vdev labels from
1.44MB floppy, though it is not very practical and quite slow.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260339 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258342:
mav [Sun, 5 Jan 2014 22:12:45 +0000 (22:12 +0000)]
MFC r258342:
Reenable vfs.zfs.zio.use_uma for amd64, disabled at r209261.

On machines with seveal CPUs and enough RAM this can easily twice improve
ZFS performance or twice reduce CPU usage.  It was disabled three years
ago due to memory and KVA exhaustion reports, but our VM subsystem got
improved a lot since that time, hopefully enough to make another try.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260338 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258137:
mav [Sun, 5 Jan 2014 22:09:18 +0000 (22:09 +0000)]
MFC r258137:
Introduce allocation cache to store LZ4 compression contexts without kicking
VM subsystem twice for every written record.

Tests on 24-core system show double reduction of CPU time spent on copying
single large well-compressed file.

This patch is not really needed on illumos (while not harm either) since
their memory allocator by default uses caching for all requests up to 128K.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258901:
sbruno [Sun, 5 Jan 2014 17:29:53 +0000 (17:29 +0000)]
MFC r258901:

svn r251516 resized the buf argument a bit too much. Pass a hardcoded
size of 6 to humanize_number() to resolve this.

PR: bin/184405
Submitted by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/10@260324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoRevert MFC of r260102 for now, until I can merge the required fix from
dim [Sun, 5 Jan 2014 15:39:37 +0000 (15:39 +0000)]
Revert MFC of r260102 for now, until I can merge the required fix from
head.  This should fix building modules which require -fms-extensions to
compile them with gcc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260321 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r260188 from head:
glebius [Sun, 5 Jan 2014 13:55:33 +0000 (13:55 +0000)]
Merge r260188 from head:
  Fix regression from r249894. Now we pass "gw" as argument to if_output
  method, thus for multicast case we need it to point at "dst".

PR: 185395

git-svn-id: svn://svn.freebsd.org/base/stable/10@260319 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258256, r258390:
mav [Sat, 4 Jan 2014 23:45:55 +0000 (23:45 +0000)]
MFC r258256, r258390:
Fix umastat build on present kernel.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260307 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258716:
mav [Sat, 4 Jan 2014 23:43:18 +0000 (23:43 +0000)]
MFC r258716:
 - Add bucket size column to `show uma` DDB command.
 - Add `show umacache` command to show alike stats for cache-only UMA zones.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260306 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258693:
mav [Sat, 4 Jan 2014 23:42:24 +0000 (23:42 +0000)]
MFC r258693:
Make UMA to not blindly force offpage slab header allocation for large
(> PAGE_SIZE) zones.  If zone is not multiple to PAGE_SIZE, there may
be enough space for the header at the last page, so we may avoid extra
header memory allocation and hash table update/lookup.

ZFS creates bunch of odd-sized UMA zones (5120, 6144, 7168, 10240, 14336).
This change gives good use to at least some of otherwise lost memory there.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260305 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258691:
mav [Sat, 4 Jan 2014 23:40:47 +0000 (23:40 +0000)]
MFC r258691:
Don't count bucket allocation failures for UMA zones as their own failures.
There are good reasons for this to happen, such as recursion prevention, etc.
and they are not fatal since buckets are just an optimization mechanism.
Real bucket allocation failures are any way counted by the bucket zones
themselves, and we don't need double accounting there.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258340, r258497:
mav [Sat, 4 Jan 2014 23:39:39 +0000 (23:39 +0000)]
MFC r258340, r258497:
Implement mechanism to safely but slowly purge UMA per-CPU caches.

This is a last resort for very low memory condition in case other measures
to free memory were ineffective.  Sequentially cycle through all CPUs and
extract per-CPU cache buckets into zone cache from where they can be freed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260303 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258338:
mav [Sat, 4 Jan 2014 23:38:06 +0000 (23:38 +0000)]
MFC r258338:
Grow UMA zone bucket size also on lock congestion during item free.

Lock congestion is the same, whether it happens on alloc or free, so
handle it equally.  Now that we have back pressure, there is no problem
to grow buckets a bit faster.  Any way growth is much slower then in 9.x.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258337:
mav [Sat, 4 Jan 2014 23:37:01 +0000 (23:37 +0000)]
MFC r258337:
Add two new UMA bucket zones to store 3 and 9 items per bucket.

These new buckets make bucket size self-tuning more soft and precise.
Without them there are buckets for 1, 5, 13, 29, ... items.  While at
bigger sizes difference about 2x is fine, at smallest ones it is 5x and
2.6x respectively.  New buckets make that line look like 1, 3, 5, 9, 13,
29, reducing jumps between steps, making algorithm work softer, allocating
and freeing memory in better fitting chunks.  Otherwise there is quite a
big gap between allocating 128K and 5x128K of RAM at once.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260301 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258336:
mav [Sat, 4 Jan 2014 23:35:34 +0000 (23:35 +0000)]
MFC r258336:
Implement soft pressure on UMA cache bucket sizes.

Every time system detects low memory condition decrease bucket sizes for
each zone by one item.  As result, higher memory pressure will push to
smaller bucket sizes and so smaller per-CPU caches and so more efficient
memory use.

Before this change there was no force to oppose buckets growth as result
of practically inevitable zone lock conflicts, and after some run time
per-CPU caches could consume enough RAM to kill the system.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260300 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259232:
mav [Sat, 4 Jan 2014 23:31:34 +0000 (23:31 +0000)]
MFC r259232:
Create own free list for each of the first 32 possible allocation sizes.
In case of 4K allocation quantum that means for allocations up to 128K.

With growth of memory fragmentation these lists may grow to quite a large
sizes (tenths and hundreds of thousands items).  Having in one list items
of different sizes in worst case may require full linear list traversal,
that may be very expensive.  Having lists for items of single size means
that unless user specify some alignment or border requirements (that are
very rare cases) first item found on the list should satisfy the request.

While running SPEC NFS benchmark on top of ZFS on 24-core machine with
84GB RAM this change reduces CPU time spent in vmem_xalloc() from 8%
and lock congestion spinning around it from 20% to invisible levels.
And that all is by the cost of just 26 more pointers per vmem instance.

If at some point our kernel will start to actively use KVA allocations
with odd sizes above 128K, something may need to be done to bigger lists
also.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260299 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260112:
dim [Sat, 4 Jan 2014 23:12:01 +0000 (23:12 +0000)]
MFC r260112:

In sys/dev/sound/pci/maestro.c, #if 0 two unused static functions.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260298 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260111:
dim [Sat, 4 Jan 2014 23:00:56 +0000 (23:00 +0000)]
MFC r260111:

For sys/ofed/drivers/infiniband/hw/mlx4/mcg.c, disable warning about
unused variables for now.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260297 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260104:
dim [Sat, 4 Jan 2014 22:13:16 +0000 (22:13 +0000)]
MFC r260104:

For sys/ofed/drivers/infiniband/core/cm.c, disable warning about unused
functions for now.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260293 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260095:
dim [Sat, 4 Jan 2014 22:00:07 +0000 (22:00 +0000)]
MFC r260095:

For sys/boot/i386 and sys/boot/pc98, separate flags to be passed
directly to the linker (LD_FLAGS) from flags passed indirectly, via the
compiler driver (LDFLAGS).

This is because several Makefiles under sys/boot/i386 and sys/boot/pc98
use ${LD} directly to link, and the normal LDFLAGS value should not be
used in these cases.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260291 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260103:
dim [Sat, 4 Jan 2014 21:45:52 +0000 (21:45 +0000)]
MFC r260103:

In sys/amd64/amd64/pmap.c, remove static function pmap_is_current(),
which has been unused since r189415.

Reviewed by: alc

git-svn-id: svn://svn.freebsd.org/base/stable/10@260289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260057:
dim [Sat, 4 Jan 2014 21:32:53 +0000 (21:32 +0000)]
MFC r260057:

In sys/dev/scc, remove unused static function scc_setmreg().  While
here, invoke scc_getmreg() in two more places where it can be used.

Reviewed by: marcel

git-svn-id: svn://svn.freebsd.org/base/stable/10@260287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260056:
dim [Sat, 4 Jan 2014 21:23:49 +0000 (21:23 +0000)]
MFC r260056:

In sys/dev/vxge/vxgehal/vxgehal-ring.c, #if 0 an unused static function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260286 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260055:
dim [Sat, 4 Jan 2014 21:18:54 +0000 (21:18 +0000)]
MFC r260055:

In sys/dev/usb/wlan/if_urtw.c, #if 0 a static const variable, which has
been unused since r198194.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260284 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r258690 by mav from head:
glebius [Sat, 4 Jan 2014 19:51:57 +0000 (19:51 +0000)]
Merge r258690 by mav from head:
  Fix bug introduced at r252226, when udata argument passed to bucket_alloc()
  was used without making sure first that it was really passed for us.

  On some of my systems this bug made user argument passed by ZFS code to
  uma_zalloc_arg() unexpectedly block UMA per-CPU caches for those zones.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260280 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260054:
dim [Sat, 4 Jan 2014 19:13:25 +0000 (19:13 +0000)]
MFC r260054:

In sys/dev/tpm/tpm.c, #if 0 an unused static function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260048:
dim [Sat, 4 Jan 2014 19:04:53 +0000 (19:04 +0000)]
MFC r260048:

In sys/netgraph/netflow, use __FBSDID() instead of old-style rcs_id[].

git-svn-id: svn://svn.freebsd.org/base/stable/10@260278 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260042:
dim [Sat, 4 Jan 2014 18:58:18 +0000 (18:58 +0000)]
MFC r260042:

Remove superfluous old-style rcsid[] from if_my.c.  There is already an
__FBSDID() at the top of the file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260277 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260040:
dim [Sat, 4 Jan 2014 18:53:31 +0000 (18:53 +0000)]
MFC r260040:

In sys/dev/mcd/mcd.c, mark the static const COPYRIGHT string as __used,
so it ends up in the object file, and no warnings are emitted about it
being actually unused.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260276 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260038:
dim [Sat, 4 Jan 2014 18:48:29 +0000 (18:48 +0000)]
MFC r260038:

In sys/dev/en/midway.c, #if 0 an unused static function.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260275 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260039:
dim [Sat, 4 Jan 2014 18:33:28 +0000 (18:33 +0000)]
MFC r260039:

Turn off warnings about unused variables for a bunch of files under
contrib/ipfilter.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260274 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260026:
dim [Sat, 4 Jan 2014 18:24:45 +0000 (18:24 +0000)]
MFC r260026:

Disable warning about unused functions for ieee80211_crypto.c and
ieee80211_mesh.c for now.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260025:
dim [Sat, 4 Jan 2014 18:19:53 +0000 (18:19 +0000)]
MFC r260025:

Disable warning about unused functions for ar9300_reset.c for now.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260019:
dim [Sat, 4 Jan 2014 17:59:40 +0000 (17:59 +0000)]
MFC r260019:

For some files under sys/dev/drm2/i915, turn off warnings about unused
functions and variables, since they are contributed code.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260270 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260020:
dim [Sat, 4 Jan 2014 17:54:06 +0000 (17:54 +0000)]
MFC r260020:

For sys/dev/drm2/radeon, only use -fms-extensions with gcc.  This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do.  For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.

MFC r260102:

Similar to r260020, only use -fms-extensions with gcc, for all other
modules which require this flag to compile.  Use a GCC_MS_EXTENSIONS
variable, defined in kern.pre.mk, which can be used to easily supply the
flag (or not), depending on the compiler type.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260268 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260017:
dim [Sat, 4 Jan 2014 17:36:13 +0000 (17:36 +0000)]
MFC r260017:

Mark unused static inline functions defined by the PCTRIE_DEFINE() macro
as __unused, so warnings about them are avoided.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260266 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260016:
dim [Sat, 4 Jan 2014 17:33:05 +0000 (17:33 +0000)]
MFC r260016:

Remove superfluous old-style rcsid[] from if_sk.c.  There is already an
__FBSDID() at the top of the file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260265 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260003:
dim [Sat, 4 Jan 2014 17:27:43 +0000 (17:27 +0000)]
MFC r260003:

In libiconv_modules, surround unused static _citrus_XXX_pack_state() and
_citrus_XXX_unpack_state() functions with #if 0, for now.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260264 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260015:
dim [Sat, 4 Jan 2014 17:22:53 +0000 (17:22 +0000)]
MFC r260015:

In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by
adding a __libcpp prefix to the applicable identifiers.

Upstream is still debating about this, but we need it now, to be able to
import clang 3.4.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoRevert r258396 : teach iconv about a WCHAR_T pseudo-type
peter [Fri, 3 Jan 2014 23:36:03 +0000 (23:36 +0000)]
Revert r258396 : teach iconv about a WCHAR_T pseudo-type

git-svn-id: svn://svn.freebsd.org/base/stable/10@260249 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259464:
mav [Fri, 3 Jan 2014 20:47:51 +0000 (20:47 +0000)]
MFC r259464:
Fix periodic per-CPU timers startup on boot.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260244 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259792:
gjb [Fri, 3 Jan 2014 20:27:15 +0000 (20:27 +0000)]
MFC r259792:
  Remove references to SUP_UPDATE and CVS_UPDATE.
  Include base svn when evaluating if svn(1) exists.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260242 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259953:
kib [Fri, 3 Jan 2014 20:02:30 +0000 (20:02 +0000)]
MFC r259953:
Fix accounting for the negative cache entries when reusing v_cache_dd.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260240 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259655 (partial), r259944:
pfg [Fri, 3 Jan 2014 15:54:12 +0000 (15:54 +0000)]
MFC r259655 (partial), r259944:

gcc: merge small upstream changes.

Fix for PR c++/29928

Backport from mainline:
2007-04-24  Hui-May Chang <hm.chang@apple.com>

* reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER
instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction.

Obtained from: gcc 4.3 (rev. r124115, 124724: GPLv2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@260230 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r259681 from head:
glebius [Fri, 3 Jan 2014 12:28:33 +0000 (12:28 +0000)]
Merge r259681 from head:

  Changes:
  - Reinit uio_resid and flags before every call to soreceive().
  - Set maximum acceptable size of packet to IP_MAXPACKET. As for now the
    module doesn't support INET6.
  - Properly handle MSG_TRUNC return from soreceive().

PR: 184601

git-svn-id: svn://svn.freebsd.org/base/stable/10@260226 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259906: Draft-ietf-tcpm-initcwnd-05 became RFC6928.
pluknet [Thu, 2 Jan 2014 16:48:08 +0000 (16:48 +0000)]
MFC r259906: Draft-ietf-tcpm-initcwnd-05 became RFC6928.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259872:
pluknet [Thu, 2 Jan 2014 16:37:23 +0000 (16:37 +0000)]
MFC r259872:

 The compile time constant limit on number of swap devices was removed in 5.2.
 As such, remove the EINVAL error saying so.  Currently the vm.nswapdev sysctl
 just represents the number of added swap devices.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259870:
pluknet [Thu, 2 Jan 2014 15:43:23 +0000 (15:43 +0000)]
MFC r259870:

 Do not truncate the ``command'' column in ``ps'' output.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260196 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256838:
trasz [Thu, 2 Jan 2014 13:59:23 +0000 (13:59 +0000)]
MFC r256838:

Don't test arrays for being NULL.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260195 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258659:
trasz [Thu, 2 Jan 2014 13:48:54 +0000 (13:48 +0000)]
MFC r258659:

Fix warnings to not append "No error: 0".

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260193 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259502:
trasz [Thu, 2 Jan 2014 13:46:33 +0000 (13:46 +0000)]
MFC r259502:

Reword the part about mutual CHAP.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260192 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260106:
trasz [Thu, 2 Jan 2014 13:45:24 +0000 (13:45 +0000)]
MFC r260106:

The devd part never got implemented; remove for now, until someone actually
needs this feature and can talk to me about how it should look like.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260191 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260105:
trasz [Thu, 2 Jan 2014 13:44:01 +0000 (13:44 +0000)]
MFC r260105:

Fix typo.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260190 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years ago MFC r260070
scottl [Thu, 2 Jan 2014 01:51:54 +0000 (01:51 +0000)]
 MFC r260070

 Multi-queue NIC drivers and multi-port lagg tend to use the same lower
 bits of the flowid as each other, resulting in a poor distribution of
 packets among queues in certain cases.  Work around this by adding a
 set of sysctls for controlling a bit-shift on the flowid when doing
 multi-port aggrigation in lagg and lacp.  By default, lagg/lacp will
 now use bits 16 and higher instead of 0 and higher.

Obtained from: Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@260179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260068, r260069, r260076
scottl [Thu, 2 Jan 2014 01:44:14 +0000 (01:44 +0000)]
MFC r260068, r260069, r260076

 Add the -R option to allow fsck_ffs to restart itself when too many critical
 errors have been detected in a particular run.

 Clean up the global state variables so that a restart can happen correctly.

 Separate the global variables in fsck_ffs and fsdb to their own file.  This
 fixes header sharing with fscd.

 Correctly initialize, static-ize, and remove global variables as needed in
 dir.c.  This fixes a problem with lost+found directories that was causing
 a segfault.

 Correctly initialize, static-ize, and remove global variables as needed in
 suj.c.

 Initialize the suj globals before allocating the disk object, not after.
 Also ensure that 'preen' mode doesn't conflict with 'restart' mode

Obtained from: Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@260178 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260059, r260087:
scottl [Thu, 2 Jan 2014 01:40:19 +0000 (01:40 +0000)]
MFC r260059, r260087:

Add the '-b' flag to 'camcontrol devlist'.  This prints only the existing
buses and their parent sims, useful for creating a sim->bus->device map.

Obtained from: Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@260177 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r258281: Fix siginfo_t.si_status for wait6/waitid/SIGCHLD.
jilles [Wed, 1 Jan 2014 20:22:29 +0000 (20:22 +0000)]
MFC r258281: Fix siginfo_t.si_status for wait6/waitid/SIGCHLD.

Per POSIX, si_status should contain the value passed to exit() for
si_code==CLD_EXITED and the signal number for other si_code. This was
incorrect for CLD_EXITED and CLD_DUMPED.

This is still not fully POSIX-compliant (Austin group issue #594 says that
the full value passed to exit() shall be returned via si_status, not just
the low 8 bits) but is sufficient for a si_status-related test in libnih
(upstart, Debian/kFreeBSD).

PR: kern/184002

git-svn-id: svn://svn.freebsd.org/base/stable/10@260164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259854
rmacklem [Wed, 1 Jan 2014 02:49:45 +0000 (02:49 +0000)]
MFC: r259854
The NFSv4 server would call VOP_SETATTR() with a shared locked vnode
when a Getattr for a file is done by a client other than the one that
holds the file's delegation. This would only happen when delegations
are enabled and the problem is fixed by this patch.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259845
rmacklem [Tue, 31 Dec 2013 22:00:25 +0000 (22:00 +0000)]
MFC: r259845
An intermittent problem with NFSv4 exporting of ZFS snapshots was
reported to the freebsd-fs mailing list. I believe the problem was
caused by the Readdir operation using VFS_VGET() for a snapshot file entry
instead of VOP_LOOKUP(). This would not occur for NFSv3, since it
will do a VFS_VGET() of "." which fails with ENOTSUPP at the beginning
of the directory, whereas NFSv4 does not check "." or "..". This
patch adds a call to VFS_VGET() for the directory being read to check
for ENOTSUPP.
I also observed that the mount_on_fileid and fsid attributes were
not correct at the snapshot's auto mountpoints when looking at packet
traces for the Readdir. This patch fixes the attributes by doing a check
for different v_mount structure, even if the vnode v_mountedhere is not
set.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260144 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259801
rmacklem [Tue, 31 Dec 2013 21:56:02 +0000 (21:56 +0000)]
MFC: r259801
The NFSv4 client was passing both the p and cred arguments to
nfsv4_fillattr() as NULLs for the Getattr callback. This caused
nfsv4_fillattr() to not fill in the Change attribute for the reply.
I believe this was a violation of the RFC, but had little effect on
server behaviour. This patch passes a non-NULL p argument to fix this.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260143 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259525, r259526, r259529
pfg [Tue, 31 Dec 2013 20:15:21 +0000 (20:15 +0000)]
MFC r259525, r259526, r259529

gcc: small merges from upstream

fix ICE in rs6000 when using -fno-trapping-math.
Solves GCC-PR target/30485

Solve GCC issues:
PR middle-end/32602
PR middle-end/32603

Updates the to documentation and processing improvement.

Obtained from: gcc 4.3 (rev. 120902, 120902, 119427, 126278, 126422;
GPLv2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@260139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoBump __FreeBSD_version for MFC of r259951 - don't coalesce map entries
peter [Tue, 31 Dec 2013 17:29:03 +0000 (17:29 +0000)]
Bump __FreeBSD_version for MFC of r259951 - don't coalesce map entries
for vm_map_stack().

git-svn-id: svn://svn.freebsd.org/base/stable/10@260135 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r260125:
gjb [Tue, 31 Dec 2013 12:24:38 +0000 (12:24 +0000)]
MFC r260125:
  Bump copyright year.
  Happy New Year 2014!

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260126 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r256717:
kevlo [Tue, 31 Dec 2013 05:20:44 +0000 (05:20 +0000)]
MFC r256717:

Update firmware for run(4) to version 0.33.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoApproved by: re@ (gjb)
edavis [Mon, 30 Dec 2013 23:46:35 +0000 (23:46 +0000)]
Approved by: re@ (gjb)
Approved by: davidch (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@260114 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259771
rmacklem [Mon, 30 Dec 2013 21:24:41 +0000 (21:24 +0000)]
MFC: r259771
The NFSv4.1 client didn't return NFSv4.1 specific error codes
for the Getattr and Recall callbacks. This patch fixes it.
Since the NFSv4.1 specific error codes would only happen for
abnormal circumstances, this patch has little effect, in practice.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260109 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259089
rmacklem [Mon, 30 Dec 2013 21:20:51 +0000 (21:20 +0000)]
MFC: r259089
Document the noncontigwr NFS mount option.
This is a content change.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260108 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r259084
rmacklem [Mon, 30 Dec 2013 21:17:20 +0000 (21:17 +0000)]
MFC: r259084
For software builds, the NFS client does many small
synchronous (with FILE_SYNC) writes because non-contiguous
byte ranges in the same buffer cache block are being
written. This patch adds a new mount option "noncontigwr"
which allows the non-contiguous byte ranges to be combined,
with the dirty byte range becoming the superset of the bytes
that are dirty, if the file has not been file locked.
This reduces the number of writes significantly for software
builds. The only case where this change might break existing
applications is where an application is writing
non-overlapping byte ranges within the same buffer cache block
of a file from multiple clients concurrently.
Since such an application would normally do file locking on
the file, avoiding the byte range merge for files that have
been file locked should be sufficient for most (maybe all?) cases.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259928:
dim [Mon, 30 Dec 2013 20:32:27 +0000 (20:32 +0000)]
MFC r259928:

In sys/dev/bxe/bxe.c, remove static function bxe_has_tx_work_unload(),
which has never been used.

Reviewed by: edavis

git-svn-id: svn://svn.freebsd.org/base/stable/10@260101 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259902:
dim [Mon, 30 Dec 2013 20:27:58 +0000 (20:27 +0000)]
MFC r259902:

In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),
which has never been used, even by upstream, since its initial upstream
commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d )

git-svn-id: svn://svn.freebsd.org/base/stable/10@260100 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r257532 (by adrian):
dim [Mon, 30 Dec 2013 20:15:46 +0000 (20:15 +0000)]
MFC r257532 (by adrian):

Fix this build for clang.

MFC r259730:

To avoid having to explicitly test COMPILER_TYPE for setting
clang-specific or gcc-specific flags, introduce the following new
variables for use in Makefiles:

CFLAGS.clang
CFLAGS.gcc
CXXFLAGS.clang
CXXFLAGS.gcc

In bsd.sys.mk, these get appended to the regular CFLAGS or CXXFLAGS for
the right compiler.

MFC r259913:

For libstand and sys/boot, split off gcc-only flags into CFLAGS.gcc.

MFC r259927:

Fix pc98 build, by also forcing COMPILER_TYPE in sys/boot/pc98/boot2's
Makefile.

Pointy hat to: dim

git-svn-id: svn://svn.freebsd.org/base/stable/10@260096 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoFix 'make check-old' warnings when WITHOUT_TESTS is set.
jmmv [Mon, 30 Dec 2013 14:09:04 +0000 (14:09 +0000)]
Fix 'make check-old' warnings when WITHOUT_TESTS is set.

This is a MFC of r258025 and r257940, both of which resolve issues with
dynamically setting the list of obsolete files based on the contents
of /usr/tests.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259879: Clean up manual pages after BIND removal.
pluknet [Mon, 30 Dec 2013 13:05:19 +0000 (13:05 +0000)]
MFC r259879: Clean up manual pages after BIND removal.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260084 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259951:
kib [Mon, 30 Dec 2013 08:57:54 +0000 (08:57 +0000)]
MFC r259951:
Do not coalesce stack entry. Pass MAP_STACK_GROWS_DOWN and
MAP_STACK_GROWS_UP flags to vm_map_insert() from vm_map_stack()

git-svn-id: svn://svn.freebsd.org/base/stable/10@260081 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC of 256801, 256803, 256808, 256812, 256817, 256845, and 256860.
mckusick [Mon, 30 Dec 2013 05:22:22 +0000 (05:22 +0000)]
MFC of 256801, 256803, 256808, 256812, 256817, 256845, and 256860.
This set of changes puts in place the infrastructure to allow soft
updates to be multi-threaded. It introduces no functional changes
from its current operation.

MFC of 256860:

Allow kernels without options SOFTUPDATES to build.  This should fix the
embedded tinderboxes.

Reviewed by:    emaste

MFC of 256845:

Fix build problem on ARM (which defaults to building without soft updates).

Reported by:  Tinderbox
Sponsored by: Netflix

MFC of 256817:

Restructuring of the soft updates code to set it up so that the
single kernel-wide soft update lock can be replaced with a
per-filesystem soft-updates lock. This per-filesystem lock will
allow each filesystem to have its own soft-updates flushing thread
rather than being limited to a single soft-updates flushing thread
for the entire kernel.

Move soft update variables out of the ufsmount structure and into
their own mount_softdeps structure referenced by ufsmount field
um_softdep.  Eventually the per-filesystem lock will be in this
structure. For now there is simply a pointer to the kernel-wide
soft updates lock.

Change all instances of ACQUIRE_LOCK and FREE_LOCK to pass the lock
pointer in the mount_softdeps structure instead of a pointer to the
kernel-wide soft-updates lock.

Replace the five hash tables used by soft updates with per-filesystem
copies of these tables allocated in the mount_softdeps structure.

Several functions that flush dependencies when too many are allocated
in the kernel used to operate across all filesystems. They are now
parameterized to flush dependencies from a specified filesystem.
For now, we stick with the round-robin flushing strategy when the
kernel as a whole has too many dependencies allocated.

While there are many lines of changes, there should be no functional
change in the operation of soft updates.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

MFC of 256812:

Fourth of several cleanups to soft dependency implementation.
Add KASSERTS that soft dependency functions only get called
for filesystems running with soft dependencies. Calling these
functions when soft updates are not compiled into the system
become panic's.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

MFC of 256808:

Third of several cleanups to soft dependency implementation.
Ensure that softdep_unmount() and softdep_setup_sbupdate()
only get called for filesystems running with soft dependencies.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

MFC of 256803:

Second of several cleanups to soft dependency implementation.
Delete two unused functions in ffs_sofdep.c.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

MFC of 256801:

First of several cleanups to soft dependency implementation.
Convert three functions exported from ffs_softdep.c to static
functions as they are not used outside of ffs_softdep.c.

No functional change.

Tested by:    Peter Holm and Scott Long
Sponsored by: Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@260078 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMerge r256563:
scottl [Mon, 30 Dec 2013 05:19:27 +0000 (05:19 +0000)]
Merge r256563:

In the flowtable scanner, restart the scan at the last found position,
not at position 0.  Changes the scanner from O(N^2) to O(N).

Reviewed by:    emax
Obtained from:  Netflix

git-svn-id: svn://svn.freebsd.org/base/stable/10@260077 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259005, r259092:
pfg [Mon, 30 Dec 2013 03:39:46 +0000 (03:39 +0000)]
MFC r259005, r259092:

gcc: Add -flax-vector-conversions
gcc: new fvisibility-ms-compat option

These are useful for compatibility with newwer gcc and clang.

Obtained from: gcc 4.3 (rev. 120572, 120688, 126088; GPLv2)

git-svn-id: svn://svn.freebsd.org/base/stable/10@260074 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259868, r259881, 259955:
gjb [Mon, 30 Dec 2013 02:19:23 +0000 (02:19 +0000)]
MFC r259868, r259881, 259955:

r259868 (jmmv):
  Delay copying of resolv.conf into the chroot until /etc
  exists.

r259881 (jmmv):
  Put the release objdir inside the chroot.

259955:
  Move build_doc_ports() to the if...fi block from which it is
  called.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@260071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoAdd sample test programs.
jmmv [Sun, 29 Dec 2013 12:30:06 +0000 (12:30 +0000)]
Add sample test programs.

This is a MFC of the following into stable/10:
- r258299 Add some sample test programs.
- r258552 Generate plain sh test programs from a source file.

As usual, "make tinderbox" clean on ref10-amd64.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r259922: Fix an apparent typo.
pluknet [Sun, 29 Dec 2013 09:17:43 +0000 (09:17 +0000)]
MFC r259922: Fix an apparent typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@260035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC of 258789:
mckusick [Sun, 29 Dec 2013 07:26:48 +0000 (07:26 +0000)]
MFC of 258789:

We needlessly panic when trying to flush MKDIR_PARENT dependencies.
We had previously tried to flush all MKDIR_PARENT dependencies (and
all the NEWBLOCK pagedeps) by calling ffs_update(). However this will
only resolve these dependencies in direct blocks. So very large
directories with MKDIR_PARENT dependencies in indirect blocks had
not yet gotten flushed. As the directory is in the midst of doing a
complete sync, we simply defer the checking of the MKDIR_PARENT
dependencies until the indirect blocks have been sync'ed.

Reported by: Shawn Wallbridge of imaginaryforces.com
Tested by:   John-Mark Gurney <jmg@funkthat.com>
PR:          183424

git-svn-id: svn://svn.freebsd.org/base/stable/10@260033 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f