MFC r232799:
  - add comments to syscalls.master and linux(32)_dummy about which linux
    kernel version introduced the sysctl (based upon a linux man-page)
  - add comments to syscalls.master regarding some names of sysctls which are
    different than the linux-names (based upon the linux unistd.h)
  - add some dummy sysctls
  - name an unimplemented sysctl


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


git-svn-id: svn://svn.freebsd.org/base/stable/9@234317 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r234206:
Partially implement zipinfo (-Z) support.
This fixes some test failures seen with perl 5.12 and 5.14.

PR:	bin/166895
Submitted by:	swills


git-svn-id: svn://svn.freebsd.org/base/stable/9@234330 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge r232779 from head:
  Move determination of socket buffer sizes from startup to the first time
  a socket is used.  The previous code structure assumed that AF_INET
  sockets were always available, which is an invalid assumption on
  IPv6-only systems.

  This merges the fololowing revisions from NetBSD:
  src/usr.bin/ftp/main.c 1.120
  src/usr.bin/ftp/util.c 1.156

PR:		bin/162661
Obtained from:	NetBSD


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

mtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c


git-svn-id: svn://svn.freebsd.org/base/stable/9@234371 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge 233103, 233912 from head:

233103:
Some software think a mutex can be destroyed after it owned it, for
example, it uses a serialization point like following:
	pthread_mutex_lock(&mutex);
	pthread_mutex_unlock(&mutex);
	pthread_mutex_destroy(&muetx);
They think a previous lock holder should have already left the mutex and
is no longer referencing it, so they destroy it. To be maximum compatible
with such code, we use IA64 version to unlock the mutex in kernel, remove
the two steps unlocking code.

233912:
umtx operation UMTX_OP_MUTEX_WAKE has a side-effect that it accesses
a mutex after a thread has unlocked it, it event writes data to the mutex
memory to clear contention bit, there is a race that other threads
can lock it and unlock it, then destroy it, so it should not write
data to the mutex memory if there isn't any waiter.
The new operation UMTX_OP_MUTEX_WAKE2 try to fix the problem. It
requires thread library to clear the lock word entirely, then
call the WAKE2 operation to check if there is any waiter in kernel,
and try to wake up a thread, if necessary, the contention bit is set again
by the operation. This also mitgates the chance that other threads find
the contention bit and try to enter kernel to compete with each other
to wake up sleeping thread, this is unnecessary. With this change, the
mutex owner is no longer holding the mutex until it reaches a point
where kernel umtx queue is locked, it releases the mutex as soon as
possible.
Performance is improved when the mutex is contensted heavily.  On Intel
i3-2310M, the runtime of a benchmark program is reduced from 26.87 seconds
to 2.39 seconds, it even is better than UMTX_OP_MUTEX_WAKE which is
deprecated now. http://people.freebsd.org/~davidxu/bench/mutex_perf.c

Special code for stable/9:
And add code to detect if the UMTX_OP_MUTEX_WAKE2 is available.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234372 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r233939:
 Free ballooned pages with the corresponding malloc type.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 233296,233300:
 Prevent fs_file NULL pointer dereference.


git-svn-id: svn://svn.freebsd.org/base/stable/9@234378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Merge remote-tracking branch 'upstream/svn_stable_9' into svn_stable_9