MFC r251322:
Instead of yielding, pause for 1 tick when donating the current thread
time to the owner of the vnode lock while iterating over the free vnode
list.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251832 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250013 (by davidxu):
Remove extra code for SA_RESETHAND, it is not needed because kernel has
already done this.

Approved by:	davidxu


git-svn-id: svn://svn.freebsd.org/base/stable/9@251833 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251284:
Unify the code of check_deferred_signal() for all architectures.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251834 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251563:
 Add freebsd-update.conf(5) to OptionalObsoleteFiles.inc

PR:		179437
Approved by:	kib (mentor)


git-svn-id: svn://svn.freebsd.org/base/stable/9@251841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249205:
Replicate r245306 from SCSI to ATA.  The problem didn't appear so far,
covered by multilevel freeze mechanism, but it is better to be safe.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251846 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r250298, r250301:
Fix byte order of ATA WWN when converting it to SCSI LUN ID.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251847 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251654, r251664:
Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.

SPC-4 specification states that serial number may be property of device,
but not a specific logical unit.  People reported about FC storages using
serial number in that way, making it unusable for purposes of LUN multipath
detection.  SPC-4 states that designators associated with logical unit from
the VPD page 83h "Device Identification" should be used for that purpose.
Report first of them in the new attribute in such preference order: NAA,
EUI-64, T10 and SCSI name string.

While there, make GEOM DISK properly report GEOM::ident in XML output also
using d_getattr() method, if available.  This fixes serial numbers reporting
for SCSI disks in `geom disk list` output and confxml.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251849 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251661:
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in mvs(4).
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251850 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251659:
Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251852 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC: 248848

Commit a patch that fixes a problem in the #pragma statement when searching
for and loading dependent modules.  This addresses a bug seen with
io.d where it was being doubly included.

PR:		171678
Submitted by:	 Mark Johnston


git-svn-id: svn://svn.freebsd.org/base/stable/9@251857 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r242465:
Free the dma map -after- it's checked, not before. Or you'll be
potentially referencing already-freed memory.

MFC r242466:
Drop this from 500 to 128, to save a little space on memory constrained
platforms.

Submitted by:	adrian
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251860 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251689

Be more agressive about bootstrapping ctfmerge and ctfconvert so
builds from existing releases have a chance of working properly when
WITH_CLANG_IS_CC is enabled.


git-svn-id: svn://svn.freebsd.org/base/stable/9@251861 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r249252:
  Remove reference to the nonexistent sysctl node net.inet6.mld.stats.
  Also add cross reference to the icmp6(4).

  PR:	177696


git-svn-id: svn://svn.freebsd.org/base/stable/9@251864 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r236991:

Final whitespace trim.

Submitted by:	imp
Approved by:	marius
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251866 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r240177:

Dynamically allocate the S/G lists passed to callback routines rather than
allocating them on the stack of various bus_dmamap_load*() functions.  The
S/G lists are stored in the DMA tags.  This matches the implementation on
all other platforms.

Submitted by:	jhb
Approved by:	marius, adrian
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251868 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244414:
Properly implement pmap_[get|set]_memattr

MFC r244466:
Create an architecture-agnostic buffer pool manager that uses uma(9) to
manage a set of power-of-2 sized buffers for bus_dmamem_alloc().

MFC r244471:
Busdma enhancements, especially for managing small uncacheable buffers.

MFC r244743:
Use C comments instead of C++ comments.

MFC r244474:
We want to build subr_busdma_bufalloc.c on arm.

Submitted by:	cognet
Approved by:	marius
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251871 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244575:
The manpage states that bus_dmamap_create(9) returns ENOMEM if it can't
allocate a map or mapping resources.  That seems to imply that any memory
allocations it does must use M_NOWAIT and check for NULL.

MFC 246158:
Use pmap_kextract() instead of inlining the page table walk.
Remove the comment referencing non-existing code.

Submitted by:	kib, cognet
Approved by:	marius
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251873 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Big MFC of the physbio changes necessary for unmapped I/O.  These changes
have been in production at Netflix for several months with significant
success.

MFC r246713:

Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c.  It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code.  The MD busdma is then given a chance to do any final processing
in the complete() callback.

MFC r249538:
Some compilers issue a warning when wider integer is casted to narrow
pointer.  Supposedly shut down the warning by casting through
uintptr_t.

MFC r251479:
Simplify the checking of flags for cam_periph_mapmem().  This gets rid of
a lot of code redundancy and grossness at very minor expense.

MFC r251837:
MFC r251842:
Add infrastructure for doing compatibility shims, as has been sorely
needed for the last 10 years.  Far too much of the internal API is
exposed, and every small adjustment causes applications to stop working.
To kick this off, bump the API version to 0x17 as should have been done
with r246713, but add shims to compensate.  Thanks to the shims, there
should be no visible change in application behavior.

Submitted by:	kib, jeffr
Approved by:	kib
Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251874 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Catch up to the changes from r251874.  This isn't an MFC because the
amd(4) driver no longer exists in FreeBSD 10.

Obtained from:	Netflix


git-svn-id: svn://svn.freebsd.org/base/stable/9@251888 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r251187:

Explicitly use a pair of parentheses to ensure correct evaluation
ordering for bitwise operation.

Submitted by:	swildner (DragonFly)


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