200072 Commits

Author SHA1 Message Date
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
delphij
cfb7569733 The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security:	FreeBSD-SA-15:24.rpcbind
Security:	CVE-2015-7236
2015-09-29 18:06:27 +00:00
bdrewery
f512c74c45 MFC r288092:
Avoid adding duplicates into OBJS.  bsd.lib.mk already handles adding entries
  to OBJS based on SRCS.
2015-09-29 16:56:28 +00:00
bdrewery
e664379a0e MFC r287978:
Fix LIBRARIES_ONLY
2015-09-29 16:54:22 +00:00
mav
27f4e553cd MFC r288111: Allow AHCI driver attach to all known chips reporting RAID class.
Reported by:	Michael BlackHeart <amdmiek@gmail.com>
2015-09-29 05:25:34 +00:00
mav
004f6fe71e MFC r287819: Make CAM log errors that make it wait.
Waiting can take minutes, and it would be good for user to know what is
going on.
2015-09-29 05:23:26 +00:00
delphij
2fecae512b MFC r287770: MFV r277429:
Document -S option when zfs inherit fails on quota and
in manual pages.

Illumos ZFS issues:

    5410 Document -S option to zfs inherit
    https://illumos.org/issues/5410

    5412 Mention -S option when zfs inherit fails on quota
    https://illumos.org/issues/5412

illumos/illumos-gate@5ff8cfa92e
2015-09-28 18:58:27 +00:00
mav
71c5cd08a3 MFC r287289: Attach pass driver to LUNs is OFFLINE state.
Previously such LUNs were silently ignored.  But while they indeed unable
to process most of SCSI commands, some, like RTPG, they still can.
2015-09-28 12:30:22 +00:00
alc
cf3ae90393 MFC r266588
There is no reason to perform the pmap_remove() on the kernel pmap while
  the kmem object lock is held.  Do the pmap_remove() before acquiring the
  kmem object lock.
2015-09-27 05:45:16 +00:00
alc
49ac252d07 MFC r283795
Document vm_page_alloc_contig()'s support for the VM_ALLOC_NODUMP option.
2015-09-27 05:26:22 +00:00
alc
1b04bd851b MFC r288025
Correct a non-fatal error in vm_pageout_worker().  vm_pageout_worker()
  should not assume that vm_pages_needed will remain set while it sleeps.
  Other threads can clear vm_pages_needed by performing a sufficient
  number of vm_page_free() calls, e.g., process termination.  The effect
  of this error was that vm_pageout_worker() would free and/or launder
  pages when, in fact, there was no shortage of free pages.

  Rewrite a nearby comment to describe all of the possible cases and not
  just the most common case.  The problem being that the comment made
  the most common case seem like the only case.
2015-09-27 04:47:08 +00:00
alc
40b680d8ca MFC r285282
The intention of r254304 was to scan the active queue continuously.
  However, I've observed the active queue scan stopping when there are
  frequent free page shortages and the inactive queue is steadily refilled
  by other mechanisms, such as the sequential access heuristic in vm_fault()
  or madvise(2).  To remedy this problem, record the time of the last active
  queue scan, and always scan a number of pages proportional to the time
  since the last scan, regardless of whether that last scan was a
  timeout-triggered ("pass == 0") or free-page-shortage-triggered ("pass >
  0") scan.

  Also, on a timeout-triggered scan, allow a full scan of the active queue
  when the system is short of inactive pages.
2015-09-27 04:36:09 +00:00
alc
ecb8678c0a MFC r286513, r286784
Revise the text about the atomicity of the defined operations across
  multiple processors.  In particular, clearly state that the operations
  are always atomic when they are applied to the default memory type
  that is used by the kernel (and applications).

  Stop describing an acquire operation as a read barrier and a release
  operation as a write barrier.  That description has never been correct,
  and it has caused confusion.

  Also, explicitly say that a thread doesn't see its own accesses being
  reordered.  The reordering of a thread's accesses is only (potentially)
  visible to another thread.
2015-09-27 04:25:07 +00:00
alc
0abc9d77e0 MFC r285428
Correct the description of MADV_DONTNEED.
2015-09-27 04:17:08 +00:00
kib
1e7a737734 MFC r288001:
Use tabs for indend.
2015-09-27 01:37:30 +00:00
alc
32fcd5e4dc MFC r287121
Testing whether a page is dirty does not require the page lock.
2015-09-27 01:35:32 +00:00