The vinactive() call in vgonel() may start writes for the dirty pages,
creating delayed write buffers belonging to the reclaimed vnode.  Put
the buffer cleanup code after inactivation.

Add asserts that ensure that buffer queues are empty and add BO_DEAD
flag for bufobj to check that no buffers are added after the cleanup.
BO_DEAD is only used by INVARIANTS-enabled kernels.

Reported and tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Only sleep interruptible while waiting for suspension end when
filesystem specified VFCF_SBDRY flag, i.e. for NFS.

There are two issues with the sleeps.  First, applications may get
unexpected EINTR from the disk i/o syscalls.  Second, interruptible
sleep allows the stop of the process, and since mount point is
referenced while thread sleeps, unmount cannot free mount point
structure' memory, blocking unmount indefinitely.

Even for NFS, it is probably only reasonable to enable PCATCH for intr
mounts, but this information is currently not available at VFS level.

Reported and tested by:	pho (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Add facility to stop all userspace processes.  The supposed use of the
feature is to quisce the system before suspend.

Stop is implemented by reusing the thread_single(9) with the special
mode SINGLE_ALLPROC.  SINGLE_ALLPROC differs from the existing
single-threading modes by allowing (requiring) caller to operate on
other process.  Interruptible sleeps for !TDF_SBDRY threads are
suspended like SIGSTOP does it, instead of aborting the sleep, like
SINGLE_NO_EXIT, to avoid spurious EINTRs on resume.

Provide debugging sysctl debug.stop_all_proc, which causes total stop
and suspends syncer, while waiting for variable reset for resume.  It
is used for debugging; should be removed after the real use of the
interface is added.

In collaboration with:	pho
Discussed with:	avg
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Fix markup.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Update llvm patches for r274286 and r275633 so all the tests will pass.
MFV r247174:

Expose arc_meta_limit, et al via kstats.

Note that as a result, vfs.zfs.arc_meta_used is removed.
The existing vfs.zfs.arc_meta_limit sysctl/tunable is retained
with a SYSCTL_PROC wrapper.

Illumos ZFS issues:
    3561 arc_meta_limit should be exposed via kstats

Relnotes:	yes
MFC after:	2 weeks
Add _NEW flag to mtx(9), sx(9), rmlock(9) and rwlock(9).
A _NEW flag passed to _init_flags() to avoid check for double-init.

Differential Revision:	https://reviews.freebsd.org/D1208
Reviewed by:	jhb, wblock
MFC after:	1 Month
Fix quick_exit(3) manual page to match reality - the status was missing.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Fix gcc build.

Sponsored by:	The FreeBSD Foundation
MFC after:	13 days
Fix spurious "child process X terminated with exit status 1" messages
from automountd(8).

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Fix bug that made automount(8) never unmount stale autofs(5) mounts,
ie mounts for entries that were there in auto_master(5), and then
got removed.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Update patch-r274286-llvm-r201784-asm-dollar.diff, so
test/MC/AsmParser/macros.s is properly deleted when patching.
Pull in r221170 from upstream clang trunk (by Roman Divacky):

  Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.

Reviewed by:	jhibbits
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1308
Add clang patch corresponding to r275759.
Clean up, reindent, add a special case for NIS / LDAP line

MFC after:	1 week
sh: Make sure output suitable as shell input is also printable.

Commands like 'export -p', 'set' and 'trap', and tracing enabled via 'set
-x' generate output suitable as shell input by adding quotes as necessary.

If there are control characters other than newline or invalid UTF-8
sequences, use $'...' and \OOO to display them safely.

The resulting output is not parsable by a strict POSIX.1-2008 shell but sh
from FreeBSD 9.0 and newer and many other shells can parse it.
Add a vigr(8) utility which does for /etc/group what vipw(8) does for
/etc/master.passwd.
Update clang patch for r275759 to use correct test cases.
Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
architectures.

Differential Revision:	https://reviews.freebsd.org/D1307
Reviewed by:	jhibbits
merge