SCOPE6_LOCK protects V_sid_default, no need to acquire it without
any access to V_sid_default.

Sponsored by:	Yandex LLC
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243029 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
The function pmap_alloc_direct_page() unconditionally zeroes the returned
page.  Therefore, it is really inappropriate for use by the function
uma_small_alloc().  The effect of using it was that every page was zeroed
at least once and possibly twice if M_ZERO was passed as a "wait" flag.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243030 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
if_afdata lock was converted from mutex to rwlock a long ago, so we can
replace IF_AFDATA_LOCK() macro depending to the access type.

Sponsored by:	Yandex LLC
MFC after:	1 week


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243031 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Use defined() to test macro definitions.

Approved by:	theraven


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243032 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix the lookup in the DOTDOT case in the same way as other filesystems do,
i.e. inlining the vn_vget_ino() algorithm.

Sponsored by:	iXsystems inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243033 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In crypto/heimdal/lib/sl/slc-lex.l, don't define YY_NO_INPUT, since
%option nounput is already specified.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
For mkcsmapper, conditionalize gcc-specific compile flags.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243035 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In games/fortune/fortune/fortune.c, make 'Debug' the correct type (it is
*not* a boolean).

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it
compared an enum scope_type against a yacc-generated define, so the
condition would always be false.

MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Get rid of some old debug code. It provides checks similar to the one
offered by RedZone so there's no need to keep it.

Sponsored by:	iXsystems inc.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243038 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove M_USE_RESERVE from the devfs cdp allocator, which is one of two
uses of M_USE_RESERVE in the kernel. This allocation is not special.

Reviewed by:	alc
Tested by:	pho
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243039 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Flip the semantic of M_NOWAIT to only require the allocation to not
sleep, and perform the page allocations with VM_ALLOC_SYSTEM
class. Previously, the allocation was also allowed to completely drain
the reserve of the free pages, being translated to VM_ALLOC_INTERRUPT
request class for vm_page_alloc() and similar functions.

Allow the caller of malloc* to request the 'deep drain' semantic by
providing M_USE_RESERVE flag, now translated to VM_ALLOC_INTERRUPT
class. Previously, it resulted in less aggressive VM_ALLOC_SYSTEM
allocation class.

Centralize the translation of the M_* malloc(9) flags in the single
inline function malloc2vm_flags().

Discussion started by:	"Sears, Steven" <Steven.Sears@netapp.com>
Reviewed by:	alc, mdf (previous version)
Tested by:	pho (previous version)
MFC after:	2 weeks


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243040 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
 - Implement run-time expansion of the KTR buffer via sysctl.
 - Implement a function to ensure that all preempted threads have switched
   back out at least once.  Use this to make sure there are no stale
   references to the old ktr_buf or the lock profiling buffers before
   updating them.

Reviewed by:	marius (sparc64 parts), attilio (earlier patch)
Sponsored by:	EMC / Isilon Storage Division


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243046 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Make sure the final descriptor in an aggregate has rate control information.

This was broken by me when merging the 802.11n aggregate descriptor chain
setup with the default descriptor chain setup, in preparation for supporting
AR9380 NICs.

The corner case here is quite specific - if you queue an aggregate frame
with >1 frames in it, and the last subframe has only one descriptor making
it up, then that descriptor won't have the rate control information
copied into it. Look at what happens inside ar5416FillTxDesc() if
both firstSeg and lastSeg are set to 1.

Then when ar5416ProcTxDesc() goes to fill out ts_rate based on the
transmit index, it looks at the rate control fields in that descriptor
and dutifully sets it to be 0.

It doesn't happen for non-aggregate frames - if they have one descriptor,
the first descriptor already has rate control info.

I removed the call to ath_hal_setuplasttxdesc() when I migrated the
code to use the "new" style aggregate chain routines from the HAL.
But I missed this particular corner case.

This is a bit inefficient with MIPS boards as it involves a few redundant
writes into non-cachable memory.  I'll chase that up when it matters.

Tested:

 * AR9280 STA mode, TCP iperf traffic
 * Rui Paulo <rpaulo@> first reported this and has verified it on
   his AR9160 based AP.

PR:		kern/173636


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
fix a couple of spelling errors...


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243048 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add , (comma) option to print sizes grouped and separated by thousands
using the non-monetary separator returned by localeconv(3), typically
a comma or period.

MFC after:  14 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243049 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove redundant text describing the cleanup routine.
Upstreamed:
    http://code.google.com/p/kyua/issues/detail?id=43

Submitted by:	Garrett Cooper <yanegomi@gmail.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243050 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix typos in description for exp{err,out}_mismatch_head.
Upstreamed:
    http://code.google.com/p/kyua/issues/detail?id=44

Submitted by:	Garrett Cooper <yanegomi@gmail.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243051 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add support for DragonFly and FreeBSD.
Upstreamed:
    http://code.google.com/p/kyua/issues/detail?id=45

Submitted by:	Garrett Cooper <yanegomi@gmail.com>


git-svn-id: svn+ssh://svn.freebsd.org/base/head@243052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Don't install atf.test.mk if MK_ATF == no.

Submitted by:	Garrett Cooper <yanegomi@gmail.com>


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