200087 Commits

Author SHA1 Message Date
mav
3529a708dd MFC r286574: 5445 Add more visibility via arcstats; specifically
arc_state_t stats and differentiate between "data" and "metadata"

Reviewed by: Basil Crow <basil.crow@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@4076b1bf41
2015-10-03 07:28:52 +00:00
mav
bcd238ca43 MFC r286570: 5408 managing ZFS cache devices requires lots of RAM
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Chris Williamson <Chris.Williamson@delphix.com>

illumos/illumos-gate@89c86e3229

Currently, every buffer cached in the L2ARC is accompanied by a 240-byte
header in memory, leading to very high memory consumption when using very
large cache devices. These changes significantly reduce this overhead.

Currently:

L1-only header = 176 bytes
L1 + L2 or L2-only header = 176 bytes + 32 byte checksum + 32 byte l2hdr
    = 240 bytes

Memory-optimized:

L1-only header = 176 bytes
L1 + L2 header = 176 bytes + 32 byte checksum = 208 bytes
L2-only header = 96 bytes + 32 byte checksum = 128 bytes

So overall:

          Trunk  Optimized
        +-----------------+
L1-only | 176 B  | 176 B  | (same)
        +-----------------+
L1 & L2 | 240 B  | 208 B  | (saved 32 bytes)
        +-----------------+
L2-only | 240 B  | 128 B  | (saved 116 bytes)
        +-----------------+

For an average blocksize of 8KB, this means that for the L2ARC, the ratio
of metadata to data has gone down from about 2.92% to 1.56%.  For a
'storage optimized' EC2 instance with 1600GB of SSD and 60GB of RAM, this
means that we expect a completely full L2ARC to use (1600 GB * 0.0156) /
60GB = 41% of the available memory, down from 78%.

Relnotes:	yes
2015-10-03 07:27:58 +00:00
mav
21d16f9dcd MFC r286556: Avoid 128K kmem allocations in mzap_upgrade()
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Approved by: Rich Lowe <richlowe@richlowe.net>

illumos/illumos-gate@be3e2ab906
2015-10-03 07:26:48 +00:00
mav
30536f1337 MFC r286554: 5769 Cast 'zfs bad bloc' to ULL for x86
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Richard PALO <richard@NetBSD.org>
Approved by: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@8c76e0763b
2015-10-03 07:25:59 +00:00
mav
82185078f0 MFC r286551: 5694 traverse_prefetcher does not prefetch enough
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@34d7ce052c
2015-10-03 07:25:05 +00:00
mav
95869c125a MFC r286549:
5693 ztest fails in dbuf_verify: buf[i] == 0, due to dedup and bp_override

Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@7f7ace3700
2015-10-03 07:24:12 +00:00
mav
1762d85b03 MFC r286547:
5661 ZFS: "compression = on" should use lz4 if feature is enabled

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Xin LI <delphij@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@db1741f555
2015-10-03 07:23:19 +00:00
mav
53fc33bdad MFC r286545:
5630 stale bonus buffer in recycled dnode_t leads to data corruption

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>
2015-10-03 07:22:24 +00:00
mav
68ec6bda1b MFC r286543: 5592 NULL pointer dereference in dsl_prop_notify_all_cb()
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>

illumos/illumos-gate@9d47dec048
2015-10-03 07:21:27 +00:00
mav
f2b73fb4f6 MFC r286541: 5531 NULL pointer dereference in dsl_prop_get_ds()
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@e57a022b8f
2015-10-03 07:20:26 +00:00
mav
b683cc402c MFC r286539:
5562 ZFS sa_handle's violate kmem invariants, debug kernels panic on boot

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Robert Mustacchi <rm@fingolfin.org>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@0fda3cc5c1
2015-10-03 07:19:12 +00:00
mav
80738686dc MFC r281109: Add DTrace probe to the new ARC reclaim cause added in r281026. 2015-10-03 07:17:45 +00:00
mav
8d38b66206 MFC r284591 (by avg): illums compat: use flsl/flsll for highbit/highbit64
Do that only when when fast inline versions are available.
At the moment that can be the case only in the kernel and not for all
platforms.

The original code uses the binary search and that's kept as a fallback.
This is a micro optimization.
2015-10-02 20:13:56 +00:00
mav
507088a8fa MFC r279996 (by smh): Allow zvol_geom_worker to process BIO_DELETE's
If zvol_geom_start is called with a BIO_DELETE from a thread which can
sleep it queues it for later processing by the zvol_geom_worker. The
zvol_geom_worker didn't have a delete case so would simply loose the bio
hence preventing the original caller from every completing. In addition
an other unknown types would suffer the same fate.

Allow zvol_geom_worker to process BIO_DELETE's via zvol_strategy and
return unsupported for all unknown bio types.
2015-10-02 20:09:16 +00:00
mav
70cfec0df3 MFC r277826 (by delphij):
Diff reduction with upstream.  The actual change was merged in r272483
already.
2015-10-02 20:07:03 +00:00
mav
5ba5b1d9af MFC r277452 (by will): Fix arc__shrink DTrace probe's to_free argument.
Remove the unnecessary #ifdef _KERNEL, which did not differ in the true or
false cases.  Actually set the value of to_free before using it.
2015-10-02 20:03:52 +00:00
mav
2c01639773 MFC r275780 (by delphij):
Add a loader tunable, vfs.zfs.arc_meta_min, which controls how much metadata
ZFS should keep in ARC at minimum.

In arc_evict(), when doing recycle, take more factors into account by
applying the following policy:

  1. If no evictable data, evict metadata;
  2. If no evictable metadata, evict data;
  3. If we hit arc_meta_limit, evict metadata;
  4. If we haven't hit arc_meta_min, evict data;
  5* (Illumos only, not present in new FreeBSD code, yet) evict the oldest
     cached element from data and metadata.
     (FreeBSD) evict the data type specified by caller, which is the
     existing behavior.

Note that because of our splitted locks (implemented in r205231 to improve
scalability by reducing lock contention), implementing the fifth Illumos
behavior will not be cheap, so for now just implement the 1-4 and fall back
to current behavior for 5.

Illumos issue:
    5368 ARC should cache more metadata
2015-10-02 19:59:43 +00:00
mav
39a2d00cf9 MFC r269117: Make sysctls under vfs.zfs.zfetch writeable.
I don't see any reason for them to be read-only, while tuning them without
reboot is much more convenient for experiments.
2015-10-02 19:41:47 +00:00
delphij
12a956c8b5 Fix a regression with SA-15:24 patch that prevented NIS from
working.
2015-10-02 16:36:16 +00:00
hiren
ef46b98fe1 MFC r287830
Remove unnecessary tcp state transition call.
2015-10-02 16:30:54 +00:00
bdrewery
72912c00d1 MFC r288381:
All supported releases have the -m support from r186678, so remove the
  mention of it and reword this a bit to remove 'you'.
2015-10-02 16:22:21 +00:00
bdrewery
3a03397095 MFC r288380:
Document the post-merge actions of calling tzsetup(8) and services_mkdb(8)
  added in r259134.
2015-10-02 16:21:14 +00:00
vangyzen
8f32d0c83e MFC r283924
Provide vnode in memory map info for files on tmpfs

When providing memory map information to userland, populate the vnode pointer
for tmpfs files.  Set the memory mapping to appear as a vnode type, to match
FreeBSD 9 behavior.

This fixes the use of tmpfs files with the dtrace pid provider,
procstat -v, procfs, linprocfs, pmc (pmcstat), and ptrace (PT_VM_ENTRY).

Submitted by:   Eric Badger <eric@badgerio.us> (initial revision)
Obtained from:  Dell Inc.
PR:             198431
2015-10-02 14:36:41 +00:00
vangyzen
7b3b15b300 MFC r281787
dmesg: accommodate message buffer growth between the sysctl calls

Allocate 12.5% extra space to avoid ENOMEM when the message buffer
is growing steadily.

Reported by:    Steve Wahl <steve_wahl@dell.com> (and tested)
Sponsored by:   Dell Inc.
2015-10-02 14:24:39 +00:00
vangyzen
65381bf93d MFC r281785
Always send log(9) messages to the message buffer.

It is truer to the semantics of logging for messages to *always*
go to the message buffer, where they can eventually be collected
and, in fact, be put into a log file.

This restores the behavior prior to r70239, which seems to have
changed it inadvertently.

Submitted by:   Eric Badger <eric@badgerio.us>
Obtained from:  Dell Inc.
2015-10-02 14:21:07 +00:00
vangyzen
2101014bc0 MFC r280793
pmcstat.8: fix -a flag description; improve -m flag to match

The -a flag reads a file saved by -O, not -o.

The -m flag requires the -R flag.  Copy that paragraph from -a.

Sponsored by:	Dell Inc.
2015-10-02 14:11:44 +00:00
vangyzen
c52fb6e472 MFC r280792
Clean up some cosmetic nits in kern_umtx.c, found during recent work
in this area and by the Clang static analyzer.

Remove some dead assignments.

Fix a typo in a panic string.

Use umtx_pi_disown() instead of duplicate code.

Use an existing variable instead of curthread.

Approved by:    kib (mentor until recently)
Sponsored by:   Dell Inc.
2015-10-02 13:48:32 +00:00
kib
ce6871d548 MFC r288216:
Use per-cpu values for base and last in tc_cpu_ticks().
2015-10-02 05:27:12 +00:00
gjb
09cf7d031e MFC r288374:
In addition to the ubldr file, also copy ubldr.bin to the
  MS-DOS partition.  This will help with transitioning to
  a single arm/armv6 userland build which could be used for
  all FreeBSD/armv6 images without UBLDR_LOADADDR being set
  for each board (ultimately requiring a separate buildworld
  for each currently).

Sponsored by:	The FreeBSD Foundation
2015-10-02 02:08:40 +00:00
gjb
ff233881cc MFC r288370:
In vm_copy_base(), turn off SU+J on the resultant filesystem,
  leaving only SU enabled.

Sponsored by:	The FreeBSD Foundation
2015-10-02 02:06:36 +00:00
jhb
c26ba28f12 MFC 287448:
Add more mmap tests related to character devices.
- Add cdev-related tests for bad args.
- Add two simple tests cases for mapping /dev/zero that test for
  MAP_ANON-like behavior.
2015-10-01 22:19:41 +00:00
jhb
40af7e45ad MFC 286370:
Add various tests to ensure that invalid arguments passed to mmap()
trigger failures.

Note: most of the tests that should provoke an EINVAL error do not
pass on stable/10 as stable/10 does not have the changes that added
more strict parameter checking to mmap().  Those changes will not be
merged to stable/10, so I have disabled them via #if 0 with a comment
explaining why.
2015-10-01 22:17:27 +00:00
jhb
875b574b15 MFC 286369:
Convert the map_at_zero test case to ATF.  In particular, this will
facilitate adding more mmap() tests.
2015-10-01 22:08:16 +00:00
jhb
ae84b42950 MFC 286177:
Fix a couple of markup typos.
2015-10-01 21:57:15 +00:00
jhb
f91b4f607a MFC 286256:
kgdb uses td_oncpu to determine if a thread is running and should use
a pcb from stoppcbs[] rather than the thread's PCB.  However, exited threads
retained td_oncpu from the last time they ran, and newborn threads had their
CPU fields cleared to zero during fork and thread creation since they are
in the set of fields zeroed when threads are setup.  To fix, explicitly
update the CPU fields for exiting threads in sched_throw() to reflect the
switch out and reset the CPU fields for new threads in sched_fork_thread()
to NOCPU.
2015-10-01 21:54:43 +00:00
jhb
3943d4df0c MFC 284175:
Handle X2APIC entries in the MADT for APICs with an ID < 255.  At least one
BIOS has been seen to include such entries even though the relevant specs
require that X2APIC entries only be used for CPUs with an APIC ID >= 255.

This was tested on a system with "plain" local APIC entries in the MADT
to ensure no regressions, but it has not yet been tested on a system with
X2APIC entries in the MADT.  Currently such systems do not boot at all,
and with this change they might now boot correctly.
2015-10-01 20:54:19 +00:00
jhb
31a6a8ed4c MFC 283121:
Use the proper mask when reloading sampling PMCs for Core CPUs.
2015-10-01 20:49:10 +00:00
jhb
050b8bd1a6 MFC 283624,283630:
Export a list of VM objects in the system via a sysctl.  The list can be
examined via 'vmstat -o'.  It can be used to determine which files are
using physical pages of memory and how much each is using.
2015-10-01 17:09:20 +00:00
gjb
a79133b7d5 MFC r288341, r288345, r288347:
r288341:
  Honor VMFORMATS and VMSIZE if set in release.conf. [1]

r288345:
  In followup to r288341, ensure VMFORMATS and VMSIZE are not
  set to empty values, which would result in nonintuitive build
  errors.

r288347:
  Append VMFORMATS and VMSIZE to RELEASE_RMAKEFLAGS only if
  WITH_VMIMAGES is set.

PR:		203420 [1]
Sponsored by:	The FreeBSD Foundation
2015-10-01 00:47:30 +00:00
delphij
702cf0edc4 MFC r287927:
Use strlcpy() instead of strncpy() because subsequent mkstemps expects
the string be nul-terminated.

Reviewed by:	neel
2015-10-01 00:44:45 +00:00
markj
1d526e254a MFC r288278:
Document the interface for applying advice up to the end of a file.
2015-09-30 03:36:41 +00:00
markj
0da2b55fba MFC r288276:
Fix argument ordering in vn_printf().
2015-09-30 03:35:58 +00:00
markj
8b8e712dff MFC r287806:
Preserve the device queue status before retrying a sense request in
chdone().
2015-09-30 03:33:28 +00:00
jhb
bbc4a5345e MFC 269727:
Update vmstat usage for last-argument count/wait parameters

Correct the usage in both the manpage and in usage() to indicate
that the wait interval and repetition count may be given either
with the respective -w/-c arguments, or as the final positional
arguments. [0]

The corresponding code to implement the positional arguments has
been conditional on the (always-enabled) BACKWARD_COMPATIBILITY
macro since the original 4.4-lite import.  It's no longer reasonable
to remove the functionality, so remove the macro and conditional
instead.

Note that multiple disks may be given on the command line.

While here, sort arguments and apply minor mdoc fixes.

PR:		184755 [0]
2015-09-30 00:11:06 +00:00
bdrewery
4432171c46 MFC r288154:
Similar to r266147, don't define PROG in the test subdirs.
2015-09-29 22:00:03 +00:00
bdrewery
9ee64225df MFC r288091:
vfs_mountroot_shuffle() never returns non-zero.
2015-09-29 21:54:09 +00:00
bdrewery
34455869c0 MFC r287979:
Remove redundant beforeinstall.
2015-09-29 21:47:50 +00:00
bdrewery
8808238003 MFC r287935:
Optimize makeman slightly by removing uneeded cat and extra test -s.
2015-09-29 21:45:23 +00:00
gjb
def912bcea Document SA-15:24.
Sponsored by:	The FreeBSD Foundation
2015-09-29 19:14:52 +00:00
jhb
7b63f549f4 MFC 283613,287374:
Use the cpuset API more consistently:
- Fetch the root set from cpuset_getaffinity() instead of assuming all CPUs
  from 0 to hw.ncpu are the root set.
- Use CPU_SETSIZE and CPU_FFS.
- The original notion of halted CPUs the manpage and code refers to is gone.
  Use the term "available" instead.
2015-09-29 18:39:58 +00:00