]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoprintf: Add test for width and precision in %b format
jilles [Mon, 13 Aug 2018 21:54:27 +0000 (21:54 +0000)]
printf: Add test for width and precision in %b format

PR: 229641
Submitted by: pfg

5 years agoCopy out from kernel to data, not the other way around.
brooks [Mon, 13 Aug 2018 21:53:18 +0000 (21:53 +0000)]
Copy out from kernel to data, not the other way around.

MFC after: 3 days
Sponsored by: DARPA, AFRL

5 years agoRemove the duplicated CSUM_IP6_TCP introduced in r311849 from the TX
marius [Mon, 13 Aug 2018 20:29:39 +0000 (20:29 +0000)]
Remove the duplicated CSUM_IP6_TCP introduced in r311849 from the TX
checksum capabilities of IGB-class MACs. While at it, fix the line
wrapping.

PR: 230571

5 years agoPort the mps panic-safe shutdown_final handling to mpr
imp [Mon, 13 Aug 2018 19:59:42 +0000 (19:59 +0000)]
Port the mps panic-safe shutdown_final handling to mpr

r330951 by smh fixed the mps driver to avoid deadlocks when panicing.
The same code is needed for mpr, so port it here, along with the fix
which allows the CCBs scheduled to complete avoiding at least a scary
message and likely other unintended consequences.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16663

5 years agoCall xpt_sim_poll in shutdown_final handler.
imp [Mon, 13 Aug 2018 19:59:37 +0000 (19:59 +0000)]
Call xpt_sim_poll in shutdown_final handler.

When we're shutting down, we send a number of start/stop commands to
the known targets. We have to wait for them to complete. During a
panic, the interrupts are off, and using pause to wait for them to
fire and complete won't work: we have to poll after pause returns so
the completion routines of the CCBs run so we decrement work
outstanding counts.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16663

5 years agoCreate xpt_sim_poll and refactor a bit using it.
imp [Mon, 13 Aug 2018 19:59:32 +0000 (19:59 +0000)]
Create xpt_sim_poll and refactor a bit using it.

xpt_sim_poll takes the sim to poll as an argument. It will do the
proper locking protocol, call the SIM polling routine, and then call
camisr_runqueue to process completions on any CCBs the SIM's poll
routine completed. It will be used during late shutdown when a SIM is
waiting for CCBs it sent during shutdown to finish and the scheduler
isn't running because we've panic'd.

This sequence was used twice in cam_xpt, so refactor those to use this
new function.

Sponsored by: Netflix
Differential Review: https://reviews.freebsd.org/D16663

5 years agoWhitespace nit in t4_tom.h
np [Mon, 13 Aug 2018 19:21:28 +0000 (19:21 +0000)]
Whitespace nit in t4_tom.h

5 years agoevdev: Remove evdev.ko linkage dependency on kbd driver
wulf [Mon, 13 Aug 2018 19:05:53 +0000 (19:05 +0000)]
evdev: Remove evdev.ko linkage dependency on kbd driver

Move evdev_ev_kbd_event() helper from evdev to kbd.c as otherwise evdev
unconditionally requires all keyboard and console stuff to be compiled
into the kernel. This dependency happens as evdev_ev_kbd_event() helper
references kbdsw global variable defined in kbd.c through use of
kbdd_ioctl() macro.

While here make all keyboard drivers respect evdev_rcpt_mask while setting
typematic rate and LEDs with evdev interface.

Requested by: Milan Obuch <bsd@dino.sk>
Reviewed by: hselasky, gonzo
Differential Revision: https://reviews.freebsd.org/D16614

5 years agoevdev: remove soft context from evdev methods parameter list.
wulf [Mon, 13 Aug 2018 19:00:42 +0000 (19:00 +0000)]
evdev: remove soft context from evdev methods parameter list.

Now softc should be retrieved from struct edvev * pointer
with evdev_get_softc() helper.

wmt(4) is a sample of driver that support both KPI.

Reviewed by: hselasky, gonzo
Differential Revision: https://reviews.freebsd.org/D16614

5 years ago[ig4] Fix initialization sequence for newer ig4 chips
gonzo [Mon, 13 Aug 2018 18:53:14 +0000 (18:53 +0000)]
[ig4] Fix initialization sequence for newer ig4 chips

Newer chips may require assert/deassert after power down for proper
startup. Check respective flag in DEVIDLE_CTRL and perform operation
if neccesssary.

PR: 221777
Submitted by: marc.priggemeyer@gmail.com
Obtained from: DragonFly BSD
Tested on: Thinkpad T470

5 years agoAdd a space between a variable and escaped new line.
gjb [Mon, 13 Aug 2018 17:24:31 +0000 (17:24 +0000)]
Add a space between a variable and escaped new line.

MFC after: 3 days
MFC with: r337717
Sponsored by: The FreeBSD Foundation

5 years agoAdd lang/python2, lang/python3, and lang/python to GCE images
gjb [Mon, 13 Aug 2018 17:23:43 +0000 (17:23 +0000)]
Add lang/python2, lang/python3, and lang/python to GCE images
to help avoid hard-coding 'python<MAJOR>.<MINOR>' in several
scripts in the client-side scripts.

PR: 230248
MFC after: 3 days
Submitted by: gustavo.scalet@collabora.com
Sponsored by: The FreeBSD Foundation

5 years agoAdd microcode update configuration to the default loader.conf.
markj [Mon, 13 Aug 2018 17:14:06 +0000 (17:14 +0000)]
Add microcode update configuration to the default loader.conf.

MFC after: 6 weeks
Sponsored by: The FreeBSD Foundation

5 years agoImplement kernel support for early loading of Intel microcode updates.
markj [Mon, 13 Aug 2018 17:13:09 +0000 (17:13 +0000)]
Implement kernel support for early loading of Intel microcode updates.

Updates in the format described in section 9.11 of the Intel SDM can
now be applied as one of the first steps in booting the kernel.  Updates
that are loaded this way are automatically re-applied upon exit from
ACPI sleep states, in contrast with the existing cpucontrol(8)-based
method.  For the time being only Intel updates are supported.

Microcode update files are passed to the kernel via loader(8).  The
file type must be "cpu_microcode" in order for the file to be recognized
as a candidate microcode update.  Updates for multiple CPU types may be
concatenated together into a single file, in which case the kernel
will select and apply a matching update.  Memory used to store the
update file will be freed back to the system once the update is applied,
so this approach will not consume more memory than required.

Reviewed by: kib
MFC after: 6 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16370

5 years agoPrevent some parallel swap-ins, rate-limit swapper swap-ins.
kib [Mon, 13 Aug 2018 16:48:46 +0000 (16:48 +0000)]
Prevent some parallel swap-ins, rate-limit swapper swap-ins.

If faultin() was called outside swapper (from PHOLD()), do not allow
swapper to initiate additional swap-ins.  Swapper' initiated swap-ins
are serialized because they are synchronous and executed in the
context of the thread0.  With the added limitation, we only allow
parallel swap-ins from PHOLD(), which is up to PHOLD() users to
manage, usually they do not need to.

Rate-limit swapper' swap-ins to one in the MAXSLP / 2 seconds
interval, counting faultin() swapins.

Suggested by: alc
Reviewed by: alc, markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D16610

5 years agoMerge ACPICA 20180810.
jkim [Mon, 13 Aug 2018 16:26:26 +0000 (16:26 +0000)]
Merge ACPICA 20180810.

5 years agoAdd RISC-V instructions encoding.
br [Mon, 13 Aug 2018 16:07:18 +0000 (16:07 +0000)]
Add RISC-V instructions encoding.

This is the output of
$ cat opcodes opcodes-rvc-pseudo opcodes-rvc opcodes-custom |
    ./parse-opcodes -c

It is confirmed by author that the output of parse-opcodes is
in the public domain.

This will be required for DDB disassembler.

Discussed with: Andrew Waterman <waterman@eecs.berkeley.edu>
Obtained from: https://github.com/riscv/riscv-opcodes
Sponsored by: DARPA, AFRL

5 years agolualoader: Fix parsing of negative number loader.conf(5) variables
kevans [Mon, 13 Aug 2018 14:49:07 +0000 (14:49 +0000)]
lualoader: Fix parsing of negative number loader.conf(5) variables

They would previously cause errors, as the regex for these did not tolerate
a leading negative sign, and the variable would simply not parse.

5 years agolagg: allow lacp to manage the link state
gallatin [Mon, 13 Aug 2018 14:13:25 +0000 (14:13 +0000)]
lagg: allow lacp to manage the link state

Lacp needs to manage the link state itself. Unlike other
lagg protocols, the ability of lacp to pass traffic
depends not only on the lagg members having link, but also
on the lacp protocol converging to a distributing state with the
link partner.

If we prematurely mark the link as up, then we will send a
gratuitous arp (via arp_handle_ifllchange()) before the lacp
interface is capable of passing traffic. When this happens,
the gratuitous arp is lost, and our link partner may cache
a stale mac address (eg, when the base mac address for the
lagg bundle changes, due to a BIOS change re-ordering NIC
unit numbers)

Reviewed by: jtl, hselasky
Sponsored by: Netflix

5 years agoUse the stacb instead of the asoc in state macros.
tuexen [Mon, 13 Aug 2018 13:58:45 +0000 (13:58 +0000)]
Use the stacb instead of the asoc in state macros.

This is not a functional change. Just a preparation for upcoming
dtrace state change provider support.

5 years agoMove around text in loader(8), in particular stuff related to ZFS,
trasz [Mon, 13 Aug 2018 11:56:23 +0000 (11:56 +0000)]
Move around text in loader(8), in particular stuff related to ZFS,
to restore the usual section order.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoUse consistently the macors to modify the assoc state.
tuexen [Mon, 13 Aug 2018 11:56:21 +0000 (11:56 +0000)]
Use consistently the macors to modify the assoc state.

No functional change.

5 years agoAdd USB ID for rebranded RTL8153 found on NVIDIA Jetson TX1 board.
mmel [Mon, 13 Aug 2018 07:28:25 +0000 (07:28 +0000)]
Add USB ID for rebranded RTL8153 found on NVIDIA Jetson TX1 board.

MFC after: 3 days

5 years agoImport DTS files from Linux 4.18
manu [Mon, 13 Aug 2018 06:40:20 +0000 (06:40 +0000)]
Import DTS files from Linux 4.18

5 years agoImport latest DTS files from Linux 4.18
manu [Mon, 13 Aug 2018 05:53:54 +0000 (05:53 +0000)]
Import latest DTS files from Linux 4.18

5 years agoInstall symlink for sys/nvpair.h in include/Makefile symlinks target
kevans [Mon, 13 Aug 2018 05:16:27 +0000 (05:16 +0000)]
Install symlink for sys/nvpair.h in include/Makefile symlinks target

Noticed while fixing the install/sysroot situation for libnvpair and
libzfs_core- if one uses the symlinks target, libzfs_core.h is not
installed.

5 years agolibbe(3)/bectl(8): Remove now-redundant include paths
kevans [Mon, 13 Aug 2018 05:01:19 +0000 (05:01 +0000)]
libbe(3)/bectl(8): Remove now-redundant include paths

These were previously necessary because the libnvpair and libzfs_core
includes were not installed into the SYSROOT, being a part of the copies
target in include/Makefile rather than being installed with the library.

This was fixed in r337696 and the headers are now installed properly, so we
may let go of the cruft.

5 years agolibbe(3): Light typo fix/word addition
kevans [Mon, 13 Aug 2018 03:43:49 +0000 (03:43 +0000)]
libbe(3): Light typo fix/word addition

5 years agolibbe(3): Fix be_import to delete temp snapshot
kevans [Mon, 13 Aug 2018 03:42:14 +0000 (03:42 +0000)]
libbe(3): Fix be_import to delete temp snapshot

Deleting the temp snapshot isn't immediately possible because it's the
origin of the newly imported boot environment. However, this is trivially
solved by opening the new boot environment and promoting it. The roles are
now reversed and the temp snapshot/dataset may be completely destroyed.

Remove the BUGS from libbe(3) and bectl(8).

5 years agoUse INCS for non-sys/ libnvpair and libzfs_core includes
kevans [Mon, 13 Aug 2018 03:38:32 +0000 (03:38 +0000)]
Use INCS for non-sys/ libnvpair and libzfs_core includes

While nothing was wrong with libnvpair.h, libzfs_core.h was only guarded by
MK_CDDL rather than MK_CDDL && MK_ZFS. Rather than ugl'if'ying
include/Makefile to impose the extra restriction, just move the non-sys/
includes into INCS with the respect lib builds.

This has the added bonus of allowing third party packagers to try and split
these libs out of the FreeBSD-runtime package, if they are so inclined.

The sys/ include was left alone- generally userland libraries shouldn't
install kernel headers.

MFC after: 1 week

5 years agofix static ZFS linking
mmacy [Sun, 12 Aug 2018 21:04:53 +0000 (21:04 +0000)]
fix static ZFS linking

Static linking of ZFS is a newish option and LINT doesn't include it

5 years agoipmi/opal: Enable polled mode and proper callback
jhibbits [Sun, 12 Aug 2018 20:33:55 +0000 (20:33 +0000)]
ipmi/opal: Enable polled mode and proper callback

Fix a NULL dereference that would occur any time an ioctl() was done, due to a
missing ipmi_enqueue_request callback.  Just use the default for now, until we
decide to properly enable IPMI interrupts.

Reported by: kbowling

5 years agoAdd explicit cast to silence a warning for the userland stack.
tuexen [Sun, 12 Aug 2018 14:05:15 +0000 (14:05 +0000)]
Add explicit cast to silence a warning for the userland stack.

Thanks to Felix Weinrank for providing the patch.

5 years agoMove inetd.conf to usr.sbin/inetd/
brd [Sun, 12 Aug 2018 13:29:40 +0000 (13:29 +0000)]
Move inetd.conf to usr.sbin/inetd/

This is pkgbase related as it uses CONFS to tag the file as a config file

Approved by: AllanJude (mentor)
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16693

5 years agoMove all the newsyslog related configs to usr.sbin/newsyslog/
brd [Sun, 12 Aug 2018 13:24:53 +0000 (13:24 +0000)]
Move all the newsyslog related configs to usr.sbin/newsyslog/

This is related to pkgbase and changes these to use CONFS so that these are
tagged as config files.

Approved by: AllanJude (mentor)
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16694

5 years agoAdding myself to committers-src.dot
lwhsu [Sun, 12 Aug 2018 12:58:05 +0000 (12:58 +0000)]
Adding myself to committers-src.dot

Approved by: markj (mentor)

5 years agoChasing r337661, fix systat after arc accounting change.
cy [Sun, 12 Aug 2018 07:47:44 +0000 (07:47 +0000)]
Chasing r337661, fix systat after arc accounting change.

5 years agoRemove unused stuff from iw_cxgbe.h
np [Sun, 12 Aug 2018 03:36:09 +0000 (03:36 +0000)]
Remove unused stuff from iw_cxgbe.h

5 years agoMFV/ZoL: Add dbuf hash and dbuf cache kstats
mmacy [Sun, 12 Aug 2018 03:15:30 +0000 (03:15 +0000)]
MFV/ZoL:  Add dbuf hash and dbuf cache kstats

TODO: KSTAT_TYPE_NAMED support

commit 5e021f56d3437d3523904652fe3cc23ea1f4cb70
Author: Giuseppe Di Natale <dinatale2@users.noreply.github.com>
Date:   Mon Jan 29 10:24:52 2018 -0800

    Add dbuf hash and dbuf cache kstats

    Introduce kstats about the dbuf hash and dbuf cache
    to make it easier to inspect state. This should help
    with debugging and understanding of these portions
    of the codebase.

    Correct format of dbuf kstat file.

    Introduce a dbc column to dbufs kstat to indicate if
    a dbuf is in the dbuf cache.

    Introduce field filtering in the dbufstat python script.

    Introduce a no header option to the dbufstat python script.

    Introduce a test case to test basic mru->mfu list movement
    in the ARC.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
    Closes #6906

5 years agoMFV/ZoL: Fix stack dbuf_hold_impl()
mmacy [Sun, 12 Aug 2018 02:24:18 +0000 (02:24 +0000)]
MFV/ZoL:     Fix stack dbuf_hold_impl()

commit fc5bb51f08a6c91ff9ad3559d0266eeeab0b1f61
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Thu Aug 26 10:52:00 2010 -0700

    Fix stack dbuf_hold_impl()

    This commit preserves the recursive function dbuf_hold_impl() but moves
    the local variables and function arguments to the heap to minimize
    the stack frame size.  Enough space is initially allocated on the
    stack for 20 levels of recursion.  This technique was based on commit
    34229a2f2ac07363f64ddd63e014964fff2f0671 which reduced stack usage of
    traverse_visitbp().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
5 years agofix build DN_MAX_BONUSLEN -> DN_OLD_MAX_BONUSLEN
mmacy [Sun, 12 Aug 2018 02:12:44 +0000 (02:12 +0000)]
fix build DN_MAX_BONUSLEN -> DN_OLD_MAX_BONUSLEN

5 years agoRestore legacy dnode_phys layout on tier 2 arches
mmacy [Sun, 12 Aug 2018 02:09:06 +0000 (02:09 +0000)]
Restore legacy dnode_phys layout on tier 2 arches

Evidently gcc4 doesn't support anonymous union members

5 years agoAdd an overview section to bus_dma.9.
jhb [Sun, 12 Aug 2018 01:54:05 +0000 (01:54 +0000)]
Add an overview section to bus_dma.9.

Describe the role of tags and mapping objects as abstractions.
Describe static vs dynamic transaction types and give a brief overview
of the set of functions and object life cycles used for static vs
dynamic.

While here, fix a few other typos and expand a bit on parent tags.

Reviewed by: cem, imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16652

5 years agoMFV/ZoL: Fix stack noinline
mmacy [Sun, 12 Aug 2018 01:29:30 +0000 (01:29 +0000)]
MFV/ZoL: Fix stack noinline

commit 60948de1ef976aabaa3630707bcc8b5867508507
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Thu Aug 26 10:58:36 2010 -0700

    Fix stack noinline

    Certain function must never be automatically inlined by gcc because
    they are stack heavy or called recursively.  This patch flags all
    such functions I've found as 'noinline' to prevent gcc from making
    the optimization.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
5 years agoMFV/ZoL: Fix PANIC: metaslab_free_dva(): bad DVA X:Y:Z
mmacy [Sun, 12 Aug 2018 01:17:32 +0000 (01:17 +0000)]
MFV/ZoL:    Fix PANIC: metaslab_free_dva(): bad DVA X:Y:Z

commit 81edd3e83409218879e7af293daa86b0c40eb015
Author: Peng <peng.hse@xtaotech.com>
Date:   Wed Jun 8 15:22:07 2016 +0800

    Fix PANIC: metaslab_free_dva(): bad DVA X:Y:Z

    The following scenario can result in garbage in the dn_spill field.
    The db->db_blkptr must be set to NULL when DNODE_FLAG_SPILL_BLKPTR
    is clear to ensure the dn_spill field is cleared.

    Current txg = A.
    * A new spill buffer is created. Its dbuf is initialized with
      db_blkptr = NULL and it's dirtied.

    Current txg = B.
    * The spill buffer is modified. It's marked as dirty in this txg.
    * Additional changes make the spill buffer unnecessary because the
      xattr fits into the bonus buffer, so it's removed. The dbuf is
      undirtied in this txg, but it's still referenced and cannot be
      destroyed.

    Current txg = C.
    * Starts syncing of txg A
    * dbuf_sync_leaf() is called for the spill buffer. Since db_blkptr
      is NULL, dbuf_check_blkptr() is called.
    * The dbuf starts being written and it reaches the ready state
      (not done yet).
    * A new change makes the spill buffer necessary again.
      sa_build_layouts() ends up calling dbuf_find() to locate the
      dbuf.  It finds the old dbuf because it has not been destroyed yet
      (it will be destroyed when the previous write is done and there
      are no more references). The old dbuf has db_blkptr != NULL.
    * txg A write is complete and the dbuf released. However it's still
      referenced, so it's not destroyed.

    Current txg = D.
    * Starts syncing of txg B
    * dbuf_sync_leaf() is called for the bonus buffer. Its contents are
      directly copied into the dnode, overwriting the blkptr area because,
      in txg B, the bonus buffer was big enough to hold the entire xattr.
    * At this point, the db_blkptr of the spill buffer used in txg C
      gets corrupted.

Signed-off-by: Peng <peng.hse@xtaotech.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes #3937

5 years agoMFV/ZoL: add dbuf stats
mmacy [Sun, 12 Aug 2018 01:10:18 +0000 (01:10 +0000)]
MFV/ZoL: add dbuf stats

NB: disabled pending the addition of KSTAT_TYPE_RAW support to the
SPL

commit e0b0ca983d6897bcddf05af2c0e5d01ff66f90db
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Wed Oct 2 17:11:19 2013 -0700

    Add visibility in to cached dbufs

    Currently there is no mechanism to inspect which dbufs are being
    cached by the system.  There are some coarse counters in arcstats
    by they only give a rough idea of what's being cached.  This patch
    aims to improve the current situation by adding a new dbufs kstat.

    When read this new kstat will walk all cached dbufs linked in to
    the dbuf_hash.  For each dbuf it will dump detailed information
    about the buffer.  It will also dump additional information about
    the referenced arc buffer and its related dnode.  This provides a
    more complete view in to exactly what is being cached.

    With this generic infrastructure in place utilities can be written
    to post-process the data to understand exactly how the caching is
    working.  For example, the data could be processed to show a list
    of all cached dnodes and how much space they're consuming.  Or a
    similar list could be generated based on dnode type.  Many other
    ways to interpret the data exist based on what kinds of questions
    you're trying to answer.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Prakash Surya <surya1@llnl.gov>
5 years agoMFV/ZoL: Implement large_dnode pool feature
mmacy [Sun, 12 Aug 2018 00:45:53 +0000 (00:45 +0000)]
MFV/ZoL: Implement large_dnode pool feature

commit 50c957f702ea6d08a634e42f73e8a49931dd8055
Author: Ned Bass <bass6@llnl.gov>
Date:   Wed Mar 16 18:25:34 2016 -0700

    Implement large_dnode pool feature

    Justification
    -------------

    This feature adds support for variable length dnodes. Our motivation is
    to eliminate the overhead associated with using spill blocks.  Spill
    blocks are used to store system attribute data (i.e. file metadata) that
    does not fit in the dnode's bonus buffer. By allowing a larger bonus
    buffer area the use of a spill block can be avoided.  Spill blocks
    potentially incur an additional read I/O for every dnode in a dnode
    block. As a worst case example, reading 32 dnodes from a 16k dnode block
    and all of the spill blocks could issue 33 separate reads. Now suppose
    those dnodes have size 1024 and therefore don't need spill blocks.  Then
    the worst case number of blocks read is reduced to from 33 to two--one
    per dnode block. In practice spill blocks may tend to be co-located on
    disk with the dnode blocks so the reduction in I/O would not be this
    drastic. In a badly fragmented pool, however, the improvement could be
    significant.

    ZFS-on-Linux systems that make heavy use of extended attributes would
    benefit from this feature. In particular, ZFS-on-Linux supports the
    xattr=sa dataset property which allows file extended attribute data
    to be stored in the dnode bonus buffer as an alternative to the
    traditional directory-based format. Workloads such as SELinux and the
    Lustre distributed filesystem often store enough xattr data to force
    spill bocks when xattr=sa is in effect. Large dnodes may therefore
    provide a performance benefit to such systems.

    Other use cases that may benefit from this feature include files with
    large ACLs and symbolic links with long target names. Furthermore,
    this feature may be desirable on other platforms in case future
    applications or features are developed that could make use of a
    larger bonus buffer area.

    Implementation
    --------------

    The size of a dnode may be a multiple of 512 bytes up to the size of
    a dnode block (currently 16384 bytes). A dn_extra_slots field was
    added to the current on-disk dnode_phys_t structure to describe the
    size of the physical dnode on disk. The 8 bits for this field were
    taken from the zero filled dn_pad2 field. The field represents how
    many "extra" dnode_phys_t slots a dnode consumes in its dnode block.
    This convention results in a value of 0 for 512 byte dnodes which
    preserves on-disk format compatibility with older software.

    Similarly, the in-memory dnode_t structure has a new dn_num_slots field
    to represent the total number of dnode_phys_t slots consumed on disk.
    Thus dn->dn_num_slots is 1 greater than the corresponding
    dnp->dn_extra_slots. This difference in convention was adopted
    because, unlike on-disk structures, backward compatibility is not a
    concern for in-memory objects, so we used a more natural way to
    represent size for a dnode_t.

    The default size for newly created dnodes is determined by the value of
    a new "dnodesize" dataset property. By default the property is set to
    "legacy" which is compatible with older software. Setting the property
    to "auto" will allow the filesystem to choose the most suitable dnode
    size. Currently this just sets the default dnode size to 1k, but future
    code improvements could dynamically choose a size based on observed
    workload patterns. Dnodes of varying sizes can coexist within the same
    dataset and even within the same dnode block. For example, to enable
    automatically-sized dnodes, run

     # zfs set dnodesize=auto tank/fish

    The user can also specify literal values for the dnodesize property.
    These are currently limited to powers of two from 1k to 16k. The
    power-of-2 limitation is only for simplicity of the user interface.
    Internally the implementation can handle any multiple of 512 up to 16k,
    and consumers of the DMU API can specify any legal dnode value.

    The size of a new dnode is determined at object allocation time and
    stored as a new field in the znode in-memory structure. New DMU
    interfaces are added to allow the consumer to specify the dnode size
    that a newly allocated object should use. Existing interfaces are
    unchanged to avoid having to update every call site and to preserve
    compatibility with external consumers such as Lustre. The new
    interfaces names are given below. The versions of these functions that
    don't take a dnodesize parameter now just call the _dnsize() versions
    with a dnodesize of 0, which means use the legacy dnode size.

    New DMU interfaces:
      dmu_object_alloc_dnsize()
      dmu_object_claim_dnsize()
      dmu_object_reclaim_dnsize()

    New ZAP interfaces:
      zap_create_dnsize()
      zap_create_norm_dnsize()
      zap_create_flags_dnsize()
      zap_create_claim_norm_dnsize()
      zap_create_link_dnsize()

    The constant DN_MAX_BONUSLEN is renamed to DN_OLD_MAX_BONUSLEN. The
    spa_maxdnodesize() function should be used to determine the maximum
    bonus length for a pool.

    These are a few noteworthy changes to key functions:

    * The prototype for dnode_hold_impl() now takes a "slots" parameter.
      When the DNODE_MUST_BE_FREE flag is set, this parameter is used to
      ensure the hole at the specified object offset is large enough to
      hold the dnode being created. The slots parameter is also used
      to ensure a dnode does not span multiple dnode blocks. In both of
      these cases, if a failure occurs, ENOSPC is returned. Keep in mind,
      these failure cases are only possible when using DNODE_MUST_BE_FREE.

      If the DNODE_MUST_BE_ALLOCATED flag is set, "slots" must be 0.
      dnode_hold_impl() will check if the requested dnode is already
      consumed as an extra dnode slot by an large dnode, in which case
      it returns ENOENT.

    * The function dmu_object_alloc() advances to the next dnode block
      if dnode_hold_impl() returns an error for a requested object.
      This is because the beginning of the next dnode block is the only
      location it can safely assume to either be a hole or a valid
      starting point for a dnode.

    * dnode_next_offset_level() and other functions that iterate
      through dnode blocks may no longer use a simple array indexing
      scheme. These now use the current dnode's dn_num_slots field to
      advance to the next dnode in the block. This is to ensure we
      properly skip the current dnode's bonus area and don't interpret it
      as a valid dnode.

    zdb
    ---
    The zdb command was updated to display a dnode's size under the
    "dnsize" column when the object is dumped.

    For ZIL create log records, zdb will now display the slot count for
    the object.

    ztest
    -----
    Ztest chooses a random dnodesize for every newly created object. The
    random distribution is more heavily weighted toward small dnodes to
    better simulate real-world datasets.

    Unused bonus buffer space is filled with non-zero values computed from
    the object number, dataset id, offset, and generation number.  This
    helps ensure that the dnode traversal code properly skips the interior
    regions of large dnodes, and that these interior regions are not
    overwritten by data belonging to other dnodes. A new test visits each
    object in a dataset. It verifies that the actual dnode size matches what
    was stored in the ztest block tag when it was created. It also verifies
    that the unused bonus buffer space is filled with the expected data
    patterns.

    ZFS Test Suite
    --------------
    Added six new large dnode-specific tests, and integrated the dnodesize
    property into existing tests for zfs allow and send/recv.

    Send/Receive
    ------------
    ZFS send streams for datasets containing large dnodes cannot be received
    on pools that don't support the large_dnode feature. A send stream with
    large dnodes sets a DMU_BACKUP_FEATURE_LARGE_DNODE flag which will be
    unrecognized by an incompatible receiving pool so that the zfs receive
    will fail gracefully.

    While not implemented here, it may be possible to generate a
    backward-compatible send stream from a dataset containing large
    dnodes. The implementation may be tricky, however, because the send
    object record for a large dnode would need to be resized to a 512
    byte dnode, possibly kicking in a spill block in the process. This
    means we would need to construct a new SA layout and possibly
    register it in the SA layout object. The SA layout is normally just
    sent as an ordinary object record. But if we are constructing new
    layouts while generating the send stream we'd have to build the SA
    layout object dynamically and send it at the end of the stream.

    For sending and receiving between pools that do support large dnodes,
    the drr_object send record type is extended with a new field to store
    the dnode slot count. This field was repurposed from unused padding
    in the structure.

    ZIL Replay
    ----------
    The dnode slot count is stored in the uppermost 8 bits of the lr_foid
    field. The bits were unused as the object id is currently capped at
    48 bits.

    Resizing Dnodes
    ---------------
    It should be possible to resize a dnode when it is dirtied if the
    current dnodesize dataset property differs from the dnode's size, but
    this functionality is not currently implemented. Clearly a dnode can
    only grow if there are sufficient contiguous unused slots in the
    dnode block, but it should always be possible to shrink a dnode.
    Growing dnodes may be useful to reduce fragmentation in a pool with
    many spill blocks in use. Shrinking dnodes may be useful to allow
    sending a dataset to a pool that doesn't support the large_dnode
    feature.

    Feature Reference Counting
    --------------------------
    The reference count for the large_dnode pool feature tracks the
    number of datasets that have ever contained a dnode of size larger
    than 512 bytes. The first time a large dnode is created in a dataset
    the dataset is converted to an extensible dataset. This is a one-way
    operation and the only way to decrement the feature count is to
    destroy the dataset, even if the dataset no longer contains any large
    dnodes. The complexity of reference counting on a per-dnode basis was
    too high, so we chose to track it on a per-dataset basis similarly to
    the large_block feature.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Closes #3542

5 years agobectl(8): Use strcmp, rather than trying to directly compare
kevans [Sun, 12 Aug 2018 00:09:52 +0000 (00:09 +0000)]
bectl(8): Use strcmp, rather than trying to directly compare

5 years agogetopt_long(3): Document behavior of leading characters in optstring
kevans [Sun, 12 Aug 2018 00:08:14 +0000 (00:08 +0000)]
getopt_long(3): Document behavior of leading characters in optstring

Leading '+', '-', and ':' in optstring have special meaning. We briefly
mention that the first two have special meaning in that we say
POSIXLY_CORRECT turns them off, but we don't actually document their
meaning. Add a paragraph to RETURN VALUES explaining how they control
the treatment of non-option arguments.

A leading ':' has no mention; add a note that it suppresses warnings about
missing arguments.

Reviewed by: jilles
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14142

5 years agokrb5-config build: Remove gratuitous escaping
kevans [Sun, 12 Aug 2018 00:06:21 +0000 (00:06 +0000)]
krb5-config build: Remove gratuitous escaping

MFC after: 1 week

5 years agobectl(8): Rename "index" variable, which shadows a global in some lands
kevans [Sun, 12 Aug 2018 00:00:13 +0000 (00:00 +0000)]
bectl(8): Rename "index" variable, which shadows a global in some lands

5 years agoMerge libbe(3)/bectl(8) from projects/bectl into head
kevans [Sat, 11 Aug 2018 23:50:09 +0000 (23:50 +0000)]
Merge libbe(3)/bectl(8) from projects/bectl into head

bectl(8) is an administrative interface for working with ZFS boot
environments, intended to provide a superset of the functionality provided
by sysutils/beadm.

libbe(3) is the back-end library that the required functionality has been
pulled out into for later reuse.

These were originally written for GSoC 2017 under the mentorship of
allanjude@.

bectl(8) has proven pretty stable in my testing, with the known bug
documented in the man page.

Relnotes: yes

5 years agolibbe(3)/bectl(8): More SYSROOT/GCC build fixes
kevans [Sat, 11 Aug 2018 22:45:39 +0000 (22:45 +0000)]
libbe(3)/bectl(8): More SYSROOT/GCC build fixes

- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
  deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
  but the libzfs headers are apparently a hot warning-filled mess as far as
  GCC 4.2 is concerned.

5 years agofix top after arc accounting change
mmacy [Sat, 11 Aug 2018 22:11:12 +0000 (22:11 +0000)]
fix top after arc accounting change

5 years agoEnable balanced arc pruning
mmacy [Sat, 11 Aug 2018 22:01:52 +0000 (22:01 +0000)]
Enable balanced arc pruning

Taken from:
ommit f6046738365571bd647f804958dfdff8a32fbde4
Author: Brian Behlendorf <behlendorf1@llnl.gov>
Date:   Sat May 30 09:57:53 2015 -0500

    Make arc_prune() asynchronous

    As described in the comment above arc_adapt_thread() it is critical
    that the arc_adapt_thread() function never sleep while holding a hash
    lock.  This behavior was possible in the Linux implementation because
    the arc_prune() logic was implemented to be synchronous.  Under
    illumos the analogous dnlc_reduce_cache() function is asynchronous.

    To address this the arc_do_user_prune() function is has been reworked
    in to two new functions as follows:

    * arc_prune_async() is an asynchronous implementation which dispatches
    the prune callback to be run by the system taskq.  This makes it
    suitable to use in the context of the arc_adapt_thread().

    * arc_prune() is a synchronous implementation which depends on the
    arc_prune_async() implementation but blocks until the outstanding
    callbacks complete.  This is used in arc_kmem_reap_now() where it
    is safe, and expected, that memory will be freed.

    This patch additionally adds the zfs_arc_meta_strategy module option
    while allows the meta reclaim strategy to be configured.  It defaults
    to a balanced strategy which has been proved to work well under Linux
    but the illumos meta-only strategy can be enabled.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
5 years agocxgbe(4): Move all control queues to the adapter.
np [Sat, 11 Aug 2018 21:10:08 +0000 (21:10 +0000)]
cxgbe(4): Move all control queues to the adapter.

There used to be one control queue per adapter (the mgmtq) that was
initialized during adapter init and one per port that was initialized
later during port init.  This change moves all the control queues (one
per port/channel) to the adapter so that they are initialized during
adapter init and are available before any port is up.  This allows the
driver to issue ctrlq work requests over any channel without having to
bring up any port.

MFH: 2 weeks
Sponsored by: Chelsio Communications

5 years agoExtend the info about the limitations of datasets in jails.
netchild [Sat, 11 Aug 2018 20:49:19 +0000 (20:49 +0000)]
Extend the info about the limitations of datasets in jails.

Reviewed by: allanjude
Sponsored by: Essen Hackathon

5 years agobectl(8): Add missing include path
kevans [Sat, 11 Aug 2018 20:47:35 +0000 (20:47 +0000)]
bectl(8): Add missing include path

5 years agobuildworld fix: private appears to have special meaning on FreeBSD - revert to priv
mmacy [Sat, 11 Aug 2018 20:41:42 +0000 (20:41 +0000)]
buildworld fix: private appears to have special meaning on FreeBSD - revert to priv

5 years agoAdd libzfs to prebuild_libs, libbe dependency on libzfs
kevans [Sat, 11 Aug 2018 20:32:50 +0000 (20:32 +0000)]
Add libzfs to prebuild_libs, libbe dependency on libzfs

5 years agoLimit the amount of dnode metadata in the ARC
mmacy [Sat, 11 Aug 2018 19:45:04 +0000 (19:45 +0000)]
Limit the amount of dnode metadata in the ARC

In addition import most recent arc_prune_async implementation as dependency

commit 25458cbef9e59ef9ee6a7e729ab2522ed308f88f
Author: Tim Chase <tim@chase2k.com>
Date:   Wed Jul 13 07:42:40 2016 -0500

    Limit the amount of dnode metadata in the ARC

    Metadata-intensive workloads can cause the ARC to become permanently
    filled with dnode_t objects as they're pinned by the VFS layer.
    Subsequent data-intensive workloads may only benefit from about
    25% of the potential ARC (arc_c_max - arc_meta_limit).

    In order to help track metadata usage more precisely, the other_size
    metadata arcstat has replaced with dbuf_size, dnode_size and bonus_size.

    The new zfs_arc_dnode_limit tunable, which defaults to 10% of
    zfs_arc_meta_limit, defines the minimum number of bytes which is desirable
    to be consumed by dnodes.  Attempts to evict non-metadata will trigger
    async prune tasks if the space used by dnodes exceeds this limit.

    The new zfs_arc_dnode_reduce_percent tunable specifies the amount by
    which the excess dnode space is attempted to be pruned as a percentage of
    the amount by which zfs_arc_dnode_limit is being exceeded.  By default,
    it tries to unpin 10% of the dnodes.

    The problem of dnode metadata pinning was observed with the following
    testing procedure (in this example, zfs_arc_max is set to 4GiB):

        - Create a large number of small files until arc_meta_used exceeds
          arc_meta_limit (3GiB with default tuning) and arc_prune
          starts increasing.

        - Create a 3GiB file with dd.  Observe arc_mata_used.  It will still
          be around 3GiB.

        - Repeatedly read the 3GiB file and observe arc_meta_limit as before.
          It will continue to stay around 3GiB.

    With this modification, space for the 3GiB file is gradually made
    available as subsequent demands on the ARC are made.  The previous behavior
    can be restored by setting zfs_arc_dnode_limit to the same value as the
    zfs_arc_meta_limit.

Signed-off-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
    Issue #4345
    Issue #4512
    Issue #4773
    Closes #4858

5 years agoEliminate a redundant assignment.
alc [Sat, 11 Aug 2018 19:21:53 +0000 (19:21 +0000)]
Eliminate a redundant assignment.

MFC after: 1 week

5 years agoindent(1): revert r334640 and r334632
pstef [Sat, 11 Aug 2018 19:20:06 +0000 (19:20 +0000)]
indent(1): revert r334640 and r334632

While STACKSIZE macro is indeed problematic on some systems, the commits
were wrong to shrink il[] and cstk[], because they need to be of the same
size as p_stack[] as they're accessed with the same index ps.tos.

5 years agoMove all NTP related files to usr.sbin/ntp/ntpd.
brd [Sat, 11 Aug 2018 17:42:42 +0000 (17:42 +0000)]
Move all NTP related files to usr.sbin/ntp/ntpd.

This helps with pkgbase by using CONFS to tag these as config files.

Approved by: allanjude (mentor), ian, cy
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16661

5 years agoMove all periodic related config and scripts to usr.sbin/periodic/
brd [Sat, 11 Aug 2018 17:11:08 +0000 (17:11 +0000)]
Move all periodic related config and scripts to usr.sbin/periodic/

This makes pkgbase easier by tagging these as CONFS so they are properly
tagged as config files.

Approved by: will (mentor)
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16553

5 years agopf tests: Basic test for 'set skip in $groupname'
kp [Sat, 11 Aug 2018 16:41:07 +0000 (16:41 +0000)]
pf tests: Basic test for 'set skip in $groupname'

This tests for the problem reported in PR 229241, where using a group
name in 'set skip on' did not work as expected.

Sponsored by: Essen Hackathon

5 years agopf: Take the IF_ADDR_RLOCK() when iterating over the group list
kp [Sat, 11 Aug 2018 16:37:55 +0000 (16:37 +0000)]
pf: Take the IF_ADDR_RLOCK() when iterating over the group list

We did do this elsewhere in pf, but the lock was missing here.

Sponsored by: Essen Hackathon

5 years agopf: Fix 'set skip on' for groups
kp [Sat, 11 Aug 2018 16:34:30 +0000 (16:34 +0000)]
pf: Fix 'set skip on' for groups

The pfi_skip_if() function sometimes caused skipping of groups to work,
if the members of the group used the groupname as a name prefix.
This is often the case, e.g. group lo usually contains lo0, lo1, ...,
but not always.

Rather than relying on the name explicitly check for group memberships.

Obtained from: OpenBSD (pf_if.c,v 1.62, pf_if.c,v 1.63)
Sponsored by: Essen Hackathon

5 years ago - Correct the description when jobs are executed related to load avg
netchild [Sat, 11 Aug 2018 16:29:54 +0000 (16:29 +0000)]
 - Correct the description when jobs are executed related to load avg
   to match reality (slightly different to what was submitted in the
   PR: use english word instead of math-symbol).
 - Wrap the corresponding part to below 80 characters per line.

Submitted by: yamagi@yamagi.org
PR: 202202
Sponsored by: Essen Hackathon

5 years agoRe-enable reading byte swapped NFS_MAGIC dumps.
netchild [Sat, 11 Aug 2018 16:12:23 +0000 (16:12 +0000)]
Re-enable reading byte swapped NFS_MAGIC dumps.

Fix bug introduced in r98542: previously to this revision the byte-swapped
value was compared at this place. The current check is in a conditional
section where the non-byte-swapped value was already checked to be not
the value which is checked again. As byte-swapping is activated afterwards,
it only makes sense if the byte-swapped value is checked.

Submitted by: Keith White <kwhite@site.uottawa.ca>
PR: 200059
MFC after: 1 month
Sponsored by: Essen Hackathon

5 years agoFix the build by just installing systop since testing shows it works with:
brd [Sat, 11 Aug 2018 16:06:32 +0000 (16:06 +0000)]
Fix the build by just installing systop since testing shows it works with:

dwatch -X systop

Reviewed by: kp
Approved by: allanjude (mentor)

5 years agoRemove unused MAPDESCFILE.
kevlo [Sat, 11 Aug 2018 14:45:33 +0000 (14:45 +0000)]
Remove unused MAPDESCFILE.

5 years agoMove pf.os to sbin/pfctl/
brd [Sat, 11 Aug 2018 13:58:26 +0000 (13:58 +0000)]
Move pf.os to sbin/pfctl/

Approved by: will (mentor)
Glanced at by: kp
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16557

5 years agoMove cron.d/at to usr.bin/at/
brd [Sat, 11 Aug 2018 13:52:23 +0000 (13:52 +0000)]
Move cron.d/at to usr.bin/at/

This helps with pkgbase as it tags this as a config file so it is handled as
such

Approved by: allanjude (mentor)
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16673

5 years agoMove snmpd.config to usr.sbin/bsnmpd/bsnmpd/
brd [Sat, 11 Aug 2018 13:47:28 +0000 (13:47 +0000)]
Move snmpd.config to usr.sbin/bsnmpd/bsnmpd/

This helps with pkgbase as this config file will now be tagged as a config
file

Approved by: allanjude (mentor)
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16674

5 years agoMove sysctl.conf to sbin/sysctl/ and switch to CONFS.
brd [Sat, 11 Aug 2018 13:28:03 +0000 (13:28 +0000)]
Move sysctl.conf to sbin/sysctl/ and switch to CONFS.

This helps with pkgbase to tag this config file as a config file.

Approved by: allanjude (mentor), will (mentor)
Differential Revision: https://reviews.freebsd.org/D16559

5 years agoMove ddb.conf to sbin/ddb/ and switch to CONFS.
brd [Sat, 11 Aug 2018 13:25:39 +0000 (13:25 +0000)]
Move ddb.conf to sbin/ddb/ and switch to CONFS.

This helps pkgbase as this config file will now be tagged as a config file.

Approved by: allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D16675

5 years agoMove OpenBSM to CONFS
brd [Sat, 11 Aug 2018 13:23:09 +0000 (13:23 +0000)]
Move OpenBSM to CONFS

This helps with pkgbase as these config files will be properly tagged as
config files.

Approved by: allanjude (mentor), oshogbo
Differential Revision: https://reviews.freebsd.org/D16679

5 years agoAdd svnlite to places where svn is mentioned.
netchild [Sat, 11 Aug 2018 13:18:19 +0000 (13:18 +0000)]
Add svnlite to places where svn is mentioned.

The Makefile part in the PR is solved already differently, so this
part is skipped form the PR The man page change change is slightly
changed to adapt to the way the Makefile works and to the spirit
of what is intended here.

Submitted by: Juan Ramón Molina Menor <info@juanmolina.eu>
PR: 194910
Sponsored by: Essen Hackathon

5 years agoAdd "ESI Juli@ XTe" as a supported device.
netchild [Sat, 11 Aug 2018 13:01:46 +0000 (13:01 +0000)]
Add "ESI Juli@ XTe" as a supported device.

Submitted by: Vladislav Movchan  <vladislav.movchan@gmail.com>
PR: 222025
Sponsored by: Essen Hackathon

5 years agoprintf: Fix \c in %b in printf builtin exiting the shell after r337458
jilles [Sat, 11 Aug 2018 11:13:34 +0000 (11:13 +0000)]
printf: Fix \c in %b in printf builtin exiting the shell after r337458

SVN r337458 erroneously partially reverted r265885.

This is immediately visible when running the Kyua/ATF tests for
usr.bin/printf, which actually test sh's printf builtin.

PR: 229641

5 years agoIEEE!
sevan [Sat, 11 Aug 2018 11:05:22 +0000 (11:05 +0000)]
IEEE!

Pointy hat:  myself

5 years agoPull in r338481 from upstream llvm trunk (by Chandler Carruth):
dim [Sat, 11 Aug 2018 10:42:12 +0000 (10:42 +0000)]
Pull in r338481 from upstream llvm trunk (by Chandler Carruth):

  [x86] Fix a really subtle miscompile due to a somewhat glaring bug in
  EFLAGS copy lowering.

  If you have a branch of LLVM, you may want to cherrypick this. It is
  extremely unlikely to hit this case empirically, but it will likely
  manifest as an "impossible" branch being taken somewhere, and will be
  ... very hard to debug.

  Hitting this requires complex conditions living across complex
  control flow combined with some interesting memory (non-stack)
  initialized with the results of a comparison. Also, because you have
  to arrange for an EFLAGS copy to be in *just* the right place, almost
  anything you do to the code will hide the bug. I was unable to reduce
  anything remotely resembling a "good" test case from the place where
  I hit it, and so instead I have constructed synthetic MIR testing
  that directly exercises the bug in question (as well as the good
  behavior for completeness).

  The issue is that we would mistakenly assume any SETcc with a valid
  condition and an initial operand that was a register and a virtual
  register at that to be a register *defining* SETcc...

  It isn't though....

  This would in turn cause us to test some other bizarre register,
  typically the base pointer of some memory. Now, testing this register
  and using that to branch on doesn't make any sense. It even fails the
  machine verifier (if you are running it) due to the wrong register
  class. But it will make it through LLVM, assemble, and it *looks*
  fine... But wow do you get a very unsual and surprising branch taken
  in your actual code.

  The fix is to actually check what kind of SETcc instruction we're
  dealing with. Because there are a bunch of them, I just test the
  may-store bit in the instruction. I've also added an assert for
  sanity that ensure we are, in fact, *defining* the register operand.
  =D

Noticed by: kib
MFC after: 1 week

5 years agoDrop the ternary operator for calculating ssid display length in list_scan().
sevan [Sat, 11 Aug 2018 10:21:21 +0000 (10:21 +0000)]
Drop the ternary operator for calculating ssid display length in list_scan().
Regardless if a verbose scan is required or not, we'd still want to display the
full SSID name by default so use the IEE80211_NWID_LEN constant to set the
value to use instead.

Tested on rene@'s laptop.
Reviewed by: kp
Sponsored by: Essen Hackathon
Differential Revision: https://reviews.freebsd.org/D16566

5 years agoAdvise reader to also see mdconfig(8) in mount_cd9660(8).
sevan [Sat, 11 Aug 2018 08:34:24 +0000 (08:34 +0000)]
Advise reader to also see mdconfig(8) in mount_cd9660(8).
It's useful for how to mount an iso file via loopback.

Reviewed by: jilles
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D16067

5 years agodwatch(1): Add systop profile
dteske [Sat, 11 Aug 2018 06:32:31 +0000 (06:32 +0000)]
dwatch(1): Add systop profile

Provides a top-like view of syscall consumers.

MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

5 years agodwatch(1): Fix syntax error in vop_readdir profile
dteske [Sat, 11 Aug 2018 06:13:11 +0000 (06:13 +0000)]
dwatch(1): Fix syntax error in vop_readdir profile

Reported by: Arne Ehrlich <ehrlich@consider-it.de>
MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.

5 years agocxgbe(4): Create two variants of service_iq, one for queues with
np [Sat, 11 Aug 2018 04:55:47 +0000 (04:55 +0000)]
cxgbe(4): Create two variants of service_iq, one for queues with
freelists and one for those without.

MFH: 3 weeks
Sponsored by: Chelsio Communications

5 years agoMFH @ r337607, in preparation for boarding
kevans [Sat, 11 Aug 2018 04:26:29 +0000 (04:26 +0000)]
MFH @ r337607, in preparation for boarding

5 years agoDestroy a couple of rogue svn:mergeinfo
kevans [Sat, 11 Aug 2018 04:23:03 +0000 (04:23 +0000)]
Destroy a couple of rogue svn:mergeinfo

5 years agobectl(8): Also document the import bug.
kevans [Sat, 11 Aug 2018 04:11:34 +0000 (04:11 +0000)]
bectl(8): Also document the import bug.

5 years agolibbe(3): Document the import bug...
kevans [Sat, 11 Aug 2018 04:09:42 +0000 (04:09 +0000)]
libbe(3): Document the import bug...

5 years agolibbe(3): Add to bsd.libnames.mk
kevans [Sat, 11 Aug 2018 04:07:00 +0000 (04:07 +0000)]
libbe(3): Add to bsd.libnames.mk

5 years agobectl(8): Swap the order of ujail/umount documentation...
kevans [Sat, 11 Aug 2018 04:03:05 +0000 (04:03 +0000)]
bectl(8): Swap the order of ujail/umount documentation...

"Despite my inconsistency, consistency is king." -Anonymous

5 years agobectl(8): Document export/import
kevans [Sat, 11 Aug 2018 04:01:24 +0000 (04:01 +0000)]
bectl(8): Document export/import

5 years agolibbe(3): Brain dump...
kevans [Sat, 11 Aug 2018 03:33:10 +0000 (03:33 +0000)]
libbe(3): Brain dump...

5 years agostat(1): cache id->name resolution
cem [Sat, 11 Aug 2018 02:56:43 +0000 (02:56 +0000)]
stat(1): cache id->name resolution

When invoked on a large list of files, it is most common for a small number of
uids/gids to own most of the results.

Like ls(1), use pwcache(3) to avoid repeatedly looking up the same IDs.

Example microbenchmark and non-scientific results:

$ time (find /usr/src -type f -print0 | xargs -0 stat >/dev/null)

BEFORE:
3.62s user 5.23s system 102% cpu 8.655 total
3.47s user 5.38s system 102% cpu 8.647 total

AFTER:
1.23s user 1.81s system 108% cpu 2.810 total
1.43s user 1.54s system 107% cpu 2.754 total

Does this microbenchmark have any real-world significance?  Until a use case
is demonstrated otherwise, I doubt it.  Ordinarily I would be resistant to
optimizing pointless microbenchmarks in base utilities (e.g., recent totally
gratuitous changes to yes(1)).  However, the pwcache(3) APIs actually
simplify stat(1) logic ever so slightly compared to the raw APIs they wrap,
so I think this is at worst harmless.

PR: 230491
Reported by: Thomas Hurst <tom AT hur.st>
Discussed with: gad@

5 years agoAdd libbe(3) to mdoc
kevans [Sat, 11 Aug 2018 01:54:45 +0000 (01:54 +0000)]
Add libbe(3) to mdoc

5 years agolibbe(3)/bectl(8): Make igor and mandoc -Tlint a little happier
kevans [Sat, 11 Aug 2018 01:40:24 +0000 (01:40 +0000)]
libbe(3)/bectl(8): Make igor and mandoc -Tlint a little happier

5 years agolibbe(3): Bring man page back into reality
kevans [Sat, 11 Aug 2018 01:05:44 +0000 (01:05 +0000)]
libbe(3): Bring man page back into reality