If dumpdev is AUTO but no dump device has been set -- i.e., there is no swap
space configured for rc.d/dumpon to designate for dumping -- then exit
silently rather than with a
> realpath: /dev/dumpdev: No such file or directory
error message.

An argument could be made that we should print a (more informative) warning
message; but given that under the same conditions the rc.d/dumpon script will
already print a
> No suitable dump device was found
warning, it seems that printing an additional
> Dump device does not exist.  Savecore not run.
warning would be superfluous.


git-svn-id: svn://svn.freebsd.org/base/head@248487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix typo in previous commit: Exit if */dev/dumpdev* does not exist, not if
*/bin/realpath* does not exist...

Submitted by:	markj
Pointy hat to:	cperciva


git-svn-id: svn://svn.freebsd.org/base/head@248488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
There are actually two different cases when mlock(2) returns
ENOMEM. Clarify this, taking text from SUS.

Reviewed by:	kib


git-svn-id: svn://svn.freebsd.org/base/head@248489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix style and comments.


git-svn-id: svn://svn.freebsd.org/base/head@248490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Separate the locking macros that are used in the packet flow path
from others. This helps easy switch to use pfil(4) lock.


git-svn-id: svn://svn.freebsd.org/base/head@248491 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
mdoc: remove superfluous paragraph macro.


git-svn-id: svn://svn.freebsd.org/base/head@248492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Plug memory leak in dsl_check_snap_cb()
This was unnoticed because the function is very rarely used.

MFC after:	3 days


git-svn-id: svn://svn.freebsd.org/base/head@248493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove obsolete objformat information.

Submitted by:	db


git-svn-id: svn://svn.freebsd.org/base/head@248496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add new USB ID.

PR:		usb/177105
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@248499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix remainder calculation when biosize is not a power of 2

In common configurations biosize is a power of two, but is not required to
be so.  Thanks to markj@ for spotting an additional case beyond my original
patch.

Reviewed by: rmacklem@


git-svn-id: svn://svn.freebsd.org/base/head@248500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO and
XPT_ATA_IO holds virtual buffer address.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho


git-svn-id: svn://svn.freebsd.org/base/head@248501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Cast "start" to u_long. Temporary fix to unbreak tinderbox.
We need here max possible storage or dynamic, depend on size of address cell.


git-svn-id: svn://svn.freebsd.org/base/head@248502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a convenience macro bread_gb() to wrap a call to
breadn_flags(). Comparing with bread(), it adds an argument to pass
the flags to getblk().

Sponsored by:	The FreeBSD Foundation
Tested by:	pho
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
iwn(4) doesn't support adhoc mode.

PR:		misc/177106
Submitted by:	Hiren Panchasara <hiren.panchasara gmail.com>


git-svn-id: svn://svn.freebsd.org/base/head@248507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement the concept of the unmapped VMIO buffers, i.e. buffers which
do not map the b_pages pages into buffer_map KVA.  The use of the
unmapped buffers eliminate the need to perform TLB shootdown for
mapping on the buffer creation and reuse, greatly reducing the amount
of IPIs for shootdown on big-SMP machines and eliminating up to 25-30%
of the system time on i/o intensive workloads.

The unmapped buffer should be explicitely requested by the GB_UNMAPPED
flag by the consumer.  For unmapped buffer, no KVA reservation is
performed at all. The consumer might request unmapped buffer which
does have a KVA reserve, to manually map it without recursing into
buffer cache and blocking, with the GB_KVAALLOC flag.

When the mapped buffer is requested and unmapped buffer already
exists, the cache performs an upgrade, possibly reusing the KVA
reservation.

Unmapped buffer is translated into unmapped bio in g_vfs_strategy().
Unmapped bio carry a pointer to the vm_page_t array, offset and length
instead of the data pointer.  The provider which processes the bio
should explicitely specify a readiness to accept unmapped bio,
otherwise g_down geom thread performs the transient upgrade of the bio
request by mapping the pages into the new bio_transient_map KVA
submap.

The bio_transient_map submap claims up to 10% of the buffer map, and
the total buffer_map + bio_transient_map KVA usage stays the
same. Still, it could be manually tuned by kern.bio_transient_maxcnt
tunable, in the units of the transient mappings.  Eventually, the
bio_transient_map could be removed after all geom classes and drivers
can accept unmapped i/o requests.

Unmapped support can be turned off by the vfs.unmapped_buf_allowed
tunable, disabling which makes the buffer (or cluster) creation
requests to ignore GB_UNMAPPED and GB_KVAALLOC flags.  Unmapped
buffers are only enabled by default on the architectures where
pmap_copy_page() was implemented and tested.

In the rework, filesystem metadata is not the subject to maxbufspace
limit anymore. Since the metadata buffers are always mapped, the
buffers still have to fit into the buffer map, which provides a
reasonable (but practically unreachable) upper bound on it. The
non-metadata buffer allocations, both mapped and unmapped, is
accounted against maxbufspace, as before. Effectively, this means that
the maxbufspace is forced on mapped and unmapped buffers separately.
The pre-patch bufspace limiting code did not worked, because
buffer_map fragmentation does not allow the limit to be reached.

By Jeff Roberson request, the getnewbuf() function was split into
smaller single-purpose functions.

Sponsored by:	The FreeBSD Foundation
Discussed with:	jeff (previous version)
Tested by:	pho, scottl (previous version), jhb, bf
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Return "start" and "end" to u_long world. Because rman handle addresses as
u_long too.

Discussed with:	ian@
Pointy hat to:	ray@


git-svn-id: svn://svn.freebsd.org/base/head@248509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a helper function vfs_bio_bzero_buf() to zero the portion of the
buffer, transparently handling mapped or unmapped buffers.  Its intent
is to replace the use of bzero(bp->b_data) in cases where the buffer
might be unmapped, to avoid unneeded upgrades.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho


git-svn-id: svn://svn.freebsd.org/base/head@248510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
A flag for the filesystem to indicate to the upper levels that it accepts
unmapped buffers for the VOP_STRATEGY().

Sponsored by:	The FreeBSD Foundation
Tested by:	pho


git-svn-id: svn://svn.freebsd.org/base/head@248511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Pass unmapped buffers for page in requests if the filesystem indicated support
for the unmapped i/o.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho


git-svn-id: svn://svn.freebsd.org/base/head@248512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Do not map the swap i/o pbufs if the geom provider for the swap
partition accepts unmapped requests.

Sponsored by:	The FreeBSD Foundation
Tested by:	pho


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