Add sysctl to track the resource consumption of ACPI interrupts.

Submitted by:	gibbs
MFC after:	1 month
Sponsored by:	Spectra Logic
MFSpectraBSD:	636827 on 2012/09/28


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272360 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Remove lock init from radix.c.
Radix has never managed its locking itself.
The only consumer using radix with embeded rwlock
is system routing table. Move per-AF lock inits there.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Ensure that every ENTRY(foo) has a matching END(foo).
It allows to build with newer binutils

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


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272362 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Always resolve PORTSDIR to absolute paths using realpath(1).

Reported by:	madpilot
Reviewed by:	bapt
X-MFC-With:	272282


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272363 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
In the syncer, drop the sync mutex while patting the watchdog.

Some watchdog drivers (like ipmi) need to sleep while patting the watchdog.
See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK).

Submitted by:	asomers
MFC after:	1 month
Sponsored by:	Spectra Logic
MFSpectraBSD:	637548 on 2012/10/04


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272366 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Instead of requiring an edit to turn on ZFS debugging, define ZFS_DEBUG.

MFC after:	1 month


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272367 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Clean up detection of big-endian ARM. In all cases we follow the pattern
arm*eb*. Check we are building for arm and if MACHINE_ARCH follows this
pattern.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272368 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Clean up detection of hard-float ABIs. As with big-endian in r272368 we
can check against arm*hf*.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272369 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Embellish a comment regarding the reliability of DEBUG_VFS_LOCKS.

Submitted by:	kib


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272371 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Some cleanup for sfxge.4

Use standard mdoc macros instead of pure roff, fix some other mdoc usage,
make the style consistent, and fix some grammar issues.

Approved by:	hrs (mentor)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272377 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Add a sysctl, net.inet.icmp.tstamprepl, which can be used to disable replies
to ICMP Timestamp packets.

PR:		193689
Submitted by:	Anthony Cornehl <accornehl@gmail.com>
MFC after:	3 weeks
Sponsored by:	EMC / Isilon Storage Division


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272378 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Optimize program flow for execution speed. Also fix some more style(9) nits
while here:
+ Fix an issue when extracting small archives where dialog_mixedgauge was
  not rendering; leaving the user wondering if anything happened.
+ Add #ifdef's to assuage compilation against older libarchive
  NB: Minimize diff between branches; make merging easier.
+ Add missing calls to end_dialog(3)
+ Change string processing from strtok(3) to strcspn(3) (O(1) optimization)
+ Use EXIT_SUCCESS and EXIT_FAILURE instead of 0/1
+ Optimize getenv(3) use, using stored results instead of calling repeatedly
  NB: Fixes copy/paste error wherein we display getenv(BSDINSTALL_DISTDIR) in
      an error msgbox when chdir(2) to getenv(BSDINSTALL_CHROOT) fails
      (wrong variable displayed in msgbox).
+ Use strtol(3) instead of [deprecated] atoi(3)
+ Add additional error checking (e.g., check return of archive_read_new(3))
+ Assign DECONST strings to static variables
+ Fix typo in distextract.c error message (s/Could could/Could not/)
+ Add comments and make a minor whitespace adjustment

Reviewed by:	nwhitehorn, julian


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272379 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Suffix the cookie constants with ULL to silence warnings from compilers
that try to treat them as 32-bit values.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272382 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revise r272363 by collapsing the tests into a for loop.

This has the side effect of ensuring that realpath is also run for the
nominal case of PORTSDIR=/usr/ports (assuming .CURDIR is a ports directory
that relies on /usr/ports but is not rooted in it).  This ensures that any
generated PORTSDIR used is always the actual location.

Submitted by:	jkim (different implementation)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272383 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Improve performance of mking(1) by keeping a list of "chunks" in memory,
that keeps track of a particular region of the image. In particular the
image_data() function needs to return to the caller whether a region
contains data or is all zeroes. This required reading the region from
the temporary file and comparing the bytes. When image_data() is used
multiple times for the same region, this will get painful fast.

With a chunk describing a region of the image, we now also have a way
to refer to the image provided on the command line. This means we don't
need to copy the image into a temporary file. We just keep track of the
file descriptor and offset within the source file on a per-chunk basis.

For streams (pipes, sockets, fifos, etc) we now use the temporary file
as a swap file. We read from the input file and create a chunk of type
"zeroes" for each sequence of zeroes that's a multiple of the sector
size. Otherwise, we allocte from the swap file, mmap(2) it, read into
the mmap(2)'d memory and create a chunk representing data.

For regular files, we use SEEK_HOLE and SEEK_DATA to handle sparse files
eficiently and create a chunk of type zeroes for holes and a chunk of
type data for data regions. For data regions, we still compare the bytes
we read to handle differences between a file system's block size and our
sector size.

After reading all files, image_write() is used by schemes to scribble in
the reserved sectors. Since this never amounts to much, keep this data
in memory in chunks of exactly 1 sector.

The output image is created by looking using the chunk list to find the
data and write it out to the output file. For chunks of type "zeroes"
we prefer to seek, but fall back to writing zeroes to handle pipes.
For chunks of type "file" and "memoty" we simply write.

The net effect of this is that for reasonably large images the execution
time drops from 1-2 minutes to 10-20 seconds. A typical speedup is about
5 to 8 times, depending on partition sizes, output format whether in
input files are sparse or not.

Bump version to 20141001.


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272384 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Free radix mask entries on main radix destroy.
This is temporary commit to be merged to 10.
Other approach (like hash table) should be used
to store different masks.

PR:		194078
Submitted by:	Rumen Telbizov
MFC after:	3 days


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272385 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Virtualize lagg(4) cloner.  This change fixes a panic when tearing down
if_lagg(4) interfaces which were cloned in a vnet jail.

Sysctl nodes which are dynamically generated for each cloned interface
(net.link.lagg.N.*) have been removed, and use_flowid and flowid_shift
ifconfig(8) parameters have been added instead.  Flags and per-interface
statistics counters are displayed in "ifconfig -v".

CR:	D842


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272386 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
strptime: fix bug introduced in r272273.

Reported by:	portmgr (antoine)
Fix by:		Andrey Chernov, David Carlier
PR:		137307 (follow up)


git-svn-id: svn+ssh://svn.freebsd.org/base/head@272387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Diff reduction with kernel code: instruct the compiler that the data of
these types may be unaligned to their "normal" alignment and exercise
caution when accessing them.

PR:		194071
MFC after:	3 days


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


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