Another NFS SIGSTOP related fix: Ignore thread suspend requests due to
SIGSTOP if stop signals are currently deferred.  This can occur if a
process is stopped via SIGSTOP while a thread is running or runnable
but before it has set TDF_SBDRY.

Tested by:	pho
Reviewed by:	kib
MFC after:	1 week


git-svn-id: svn://svn.freebsd.org/base/head@248584 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Minimal timer period of 100us introduced in r244758 is overkill.  While
original 2us are indeed not enough, 3us are working quite well on my tests.
To be more safe set minimal period to 5us and to be even more safe replicate
here from HPET mechanism of rereading counter after programming comparator.

This change allows to handle 30K of short nanosleep() calls per second on
Raspberry Pi instead of just 8K before.

Discussed with:	gonzo


git-svn-id: svn://svn.freebsd.org/base/head@248585 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document uma_find_refcnt().


git-svn-id: svn://svn.freebsd.org/base/head@248586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document some flags to the uma_zcreate(). Not all flags are documented,
only those that at least are used in the kernel, or that definitely
work.


git-svn-id: svn://svn.freebsd.org/base/head@248588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a bug in UMTX_PROFILING:
UMTX_PROFILING should really analyze the distribution of locks as they
index entries in the umtxq_chains hash-table.
However, the current implementation does add/dec the length counters
for *every* thread insert/removal, measuring at all really userland
contention and not the hash distribution.

Fix this by correctly add/dec the length counters in the points where
it is really needed.

Please note that this bug brought us questioning in the past the quality
of the umtx hash table distribution.
To date with all the benchmarks I could try I was not able to reproduce
any issue about the hash distribution on umtx.

Sponsored by:	EMC / Isilon storage division
Reviewed by:	jeff, davide
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248591 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Allow O_CLOEXEC in posix_openpt() flags.

PR:		kern/162374
Reviewed by:	ed


git-svn-id: svn://svn.freebsd.org/base/head@248593 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Correct the page count when excess length is trimmed from the bio.

Reported and tested by:	Ivan Klymenko <fidaj@ukr.net


git-svn-id: svn://svn.freebsd.org/base/head@248596 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
- Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of type
  u_long. Before this change it was of type int for syscalls, but prototypes
  in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not
  for lchflags(2)) stated that it was u_long. Now some related functions
  use u_long type for flags (strtofflags(3), fflagstostr(3)).
- Make path argument of type 'const char *' for consistency.

Discussed on:	arch
Sponsored by:	The FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@248597 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Regenerate after r248597.

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@248598 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Implement chflagsat(2) system call, similar to fchmodat(2), but operates on
file flags.

Reviewed by:	kib, jilles
Sponsored by:	The FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@248599 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Regenerate after r248599.

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@248600 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Document chflagsat(2).

Obtained from:	jilles


git-svn-id: svn://svn.freebsd.org/base/head@248601 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix for building libzpool under i386.

Reviewed by:	pjd (mentor)
Approved by:	pjd (mentor)
MFC after:	2 weeks


git-svn-id: svn://svn.freebsd.org/base/head@248602 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Update regression tests after adding chflagsat(2).

Sponsored by:	The FreeBSD Foundation


git-svn-id: svn://svn.freebsd.org/base/head@248603 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove unused global variables.

Reviewed by:	ae, glebius


git-svn-id: svn://svn.freebsd.org/base/head@248607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Clean up some unused leftover code.

Pointed out by:	ae


git-svn-id: svn://svn.freebsd.org/base/head@248608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/master'