]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoelfcopy: Use elf_getscn() instead of iterating over all sections.
markj [Tue, 4 Jun 2019 18:29:08 +0000 (18:29 +0000)]
elfcopy: Use elf_getscn() instead of iterating over all sections.

When removing a section, we would loop over all sections looking for
a corresponding relocation section.  With r348652 it is much faster
to just use elf_getscn().

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20471

4 years agovtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants
emaste [Tue, 4 Jun 2019 18:26:42 +0000 (18:26 +0000)]
vtfontcvt: use VFNT_MAP_{NORMAL|BOL}_RH symbolic constants

PR: 205707
Reported by: Dmitry Wagin
MFC after: 1 month

4 years agolibelf: Use a red-black tree to manage the section list.
markj [Tue, 4 Jun 2019 18:26:29 +0000 (18:26 +0000)]
libelf: Use a red-black tree to manage the section list.

The tree is indexed by section number.  This speeds up elf_getscn()
and its callers, which previously had to traverse a linked list. In
particular, since .shstrtab is often the last section in a file,
elf_strptr() would have to traverse the entire list.

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20443

4 years agoIn usb(4) fix a lost completion event issue towards libusb(3). It may happen
hselasky [Tue, 4 Jun 2019 16:40:18 +0000 (16:40 +0000)]
In usb(4) fix a lost completion event issue towards libusb(3). It may happen
if a USB transfer is cancelled that we need to fake a completion event.
Implement missing support in ugen_fs_copy_out() to handle this.

This fixes issues with webcamd(8) and firefox.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoThe changes to pmap_demote_pde_locked()'s control flow in r348476 resulted
alc [Tue, 4 Jun 2019 16:21:14 +0000 (16:21 +0000)]
The changes to pmap_demote_pde_locked()'s control flow in r348476 resulted
in the loss of a KASSERT that guarded against the invalidation a wired
mapping.  Restore this KASSERT.

Remove an unnecessary KASSERT from pmap_demote_pde_locked().  It guards
against a state that was already handled at the start of the function.

Reviewed by: kib
X-MFC with: r348476

4 years agodaemon(8): Don't block SIGTERM during restart delay
cem [Tue, 4 Jun 2019 16:07:01 +0000 (16:07 +0000)]
daemon(8): Don't block SIGTERM during restart delay

I believe this was introduced in the original '-r' commit, r231911 (2012).
At the time, the scope was limited to a 1 second sleep.  r332518 (2018)
added '-R', which increased the potential duration of the affected interval
(from 1 to N seconds) by permitting arbitrary restart intervals.

Instead, handle SIGTERM normally during restart-sleep, when the monitored
process is not running, and shut down promptly.

(I noticed this behavior when debugging a child process that exited quickly
under the 'daemon -r -R 30' environment.  'kill <daemonpid>' had no
immediate effect and the monitor process slept until the next restart
attempt.  This was annoying.)

Reviewed by: allanjude, imp, markj
Differential Revision: https://reviews.freebsd.org/D20509

4 years agoelf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits
emaste [Tue, 4 Jun 2019 15:44:31 +0000 (15:44 +0000)]
elf_common: add GNU note types and NT_GNU_PROPERTY_TYPE_0 bits

To support Intel CET IBT/Shadow Stack.

Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agostyle(9) / tidying for r348611
emaste [Tue, 4 Jun 2019 13:45:30 +0000 (13:45 +0000)]
style(9) / tidying for r348611

MFC with: r348611
Event: Waterloo Hackathon 2019

4 years agoExpose the kernel's build-ID through sysctl
emaste [Tue, 4 Jun 2019 13:07:10 +0000 (13:07 +0000)]
Expose the kernel's build-ID through sysctl

After our migration (of certain architectures) to lld the kernel is built
with a unique build-ID.  Make it available via a sysctl and uname(1) to
allow the user to identify their running kernel.

Submitted by: Ali Mashtizadeh <ali_mashtizadeh.com>
MFC after: 2 weeks
Relnotes: Yes
Event: Waterloo Hackathon 2019
Differential Revision: https://reviews.freebsd.org/D20326

4 years agobuild llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)
emaste [Tue, 4 Jun 2019 13:00:49 +0000 (13:00 +0000)]
build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)

To facilitate experimentation with LTO we require an ar that supports
LLVM IR, and to a lesser degree also an nm.  As a first step always
install llvm-ar and llvm-nm.

Sponsored by: The FreeBSD Foundation

4 years agoMakefile.inc1: clean up stale dependency hacks
emaste [Tue, 4 Jun 2019 12:56:20 +0000 (12:56 +0000)]
Makefile.inc1: clean up stale dependency hacks

Carrying on from r339607, remove ad-hoc dependency cleanup for changes
prior to June 2018.

Sponsored by: The FreeBSD Foundation

4 years agoIn xhci(4) there is no stream ID in the completion TRB.
hselasky [Tue, 4 Jun 2019 09:01:02 +0000 (09:01 +0000)]
In xhci(4) there is no stream ID in the completion TRB.
Instead iterate all the stream IDs in stream mode to find
the matching USB transfer.

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoMake sure the DMA tags get freed in mlx5en(4).
hselasky [Tue, 4 Jun 2019 08:06:51 +0000 (08:06 +0000)]
Make sure the DMA tags get freed in mlx5en(4).

MFC after: 3 days
Sponsored by: Mellanox Technologies

4 years agoDon't increment cl after increment.
delphij [Tue, 4 Jun 2019 07:02:20 +0000 (07:02 +0000)]
Don't increment cl after increment.

MFC after: 3 days

4 years agoFix prio vs. nonprio tagged traffic in RDMACM
slavash [Tue, 4 Jun 2019 06:21:31 +0000 (06:21 +0000)]
Fix prio vs. nonprio tagged traffic in RDMACM

In current RDMACM implementation RDMACM server will not find a GID
index when the request was prio-tagged and the sever is non
prio-tagged and vise-versa.
According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should
be considered as untagged. Treat RDMACM request the same.

Reviewed by:    hselasky, kib
MFC after:      3 Days
Sponsored by:   Mellanox Technologies

4 years agovirtio(4): Add PNP match metadata for virtio devices
cem [Tue, 4 Jun 2019 02:37:11 +0000 (02:37 +0000)]
virtio(4): Add PNP match metadata for virtio devices

Register MODULE_PNP_INFO for virtio devices using the newbus PNP information
provided by the previous commit.  Matching can be quite simple; existing
probe routines only matched on bus (implicit) and device_type.  The same
matching criteria are retained exactly, but is now also available to
devmatch(8).

Reviewed by: bryanv, markj; imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D20407

4 years agovirtio(4): Expose PNP metadata through newbus
cem [Tue, 4 Jun 2019 02:34:59 +0000 (02:34 +0000)]
virtio(4): Expose PNP metadata through newbus

Expose the same fields and widths from both vtio buses, even though they
don't quite line up; several virtio drivers can attach to both buses,
and sharing a PNP info table for both seems more convenient.

In practice, I doubt any virtio driver really needs to match on anything
other than bus and device_type (eliminating the unused entries for
vtmmio), and also in practice device_type is << 2^16 (so far, values
range from 1 to 20).  So it might be fine to only expose a 16-bit
device_type for PNP purposes.  On the other hand, I don't see much harm
in overkill here.

Reviewed by: bryanv, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D20406

4 years agovirtio_random(4): Fix random(4) integration
cem [Tue, 4 Jun 2019 00:01:37 +0000 (00:01 +0000)]
virtio_random(4): Fix random(4) integration

random(4) masks unregistered entropy sources.  Prior to this revision,
virtio_random(4) did not correctly register a random_source and did not
function as a source of entropy.

Random source registration for loadable pure sources requires registering a
poll callback, which is invoked periodically by random(4)'s harvestq
kthread.  The periodic poll makes virtio_random(4)'s periodic entropy
collection redundant, so this revision removes the callout.

The current random source API is somewhat limiting, so simply fail to attach
any virtio_random devices if one is already registered as a source.  This
scenario is expected to be uncommon.

While here, handle the possibility of short reads from the hypervisor random
device gracefully / correctly.  It is not clear why a hypervisor would
return a short read or if it is allowed by spec, but we may as well handle
it.

Reviewed by: bryanv (earlier version), markm
Security: yes (note: many other "pure" random sources remain broken)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20419

4 years agostyle.9: Codify tolerance for eliding blank lines
cem [Mon, 3 Jun 2019 23:57:29 +0000 (23:57 +0000)]
style.9: Codify tolerance for eliding blank lines

Consensus seems to be that eliding blank lines for functions with no local
variables is acceptable.  Codify that explicitly in the style document.

Reported by: jhb
Reviewed by: delphij, imp, vangyzen (earlier version); rgrimes
With feedback from: kib
Differential Revision: https://reviews.freebsd.org/D20448

4 years agoEmulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.
jhb [Mon, 3 Jun 2019 23:17:35 +0000 (23:17 +0000)]
Emulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.

Writes are ignored and reads always return zero.

Submitted by: José Albornoz <jojo@eljojo.net> (write-only version)
Reviewed by: Patrick Mooney, cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19506

4 years agor348590 had mention of "-I" in a comment that no longer applied to the patch.
rmacklem [Mon, 3 Jun 2019 23:07:46 +0000 (23:07 +0000)]
r348590 had mention of "-I" in a comment that no longer applied to the patch.

Take "-I" out of the comment line, since the patch no longer uses the "-I"
option.

MFC after: 1 month

4 years agoModify mountd so that it incrementally updates the kernel exports upon a reload.
rmacklem [Mon, 3 Jun 2019 22:58:51 +0000 (22:58 +0000)]
Modify mountd so that it incrementally updates the kernel exports upon a reload.

Without this patch, mountd would delete/load all exports from the exports
file(s) when it receives a SIGHUP. This works fine for small exports file(s),
but can take several seconds to do when there are large numbers (10000+) of
exported file systems. Most of this time is spent doing the system calls
that delete/export each of these file systems. When the "-S" option
has been specified (the default these days), the nfsd threads are suspended
for several seconds while the reload is done.

This patch changes mountd so that it only does system calls for file systems
where the exports have been changed/added/deleted as compared to the exports
done for the previous load/reload of the exports file(s).
Basically, when SIGHUP is posted to mountd, it saves the exportlist structures
from the previous load and creates a new set of structures from the current
exports file(s). Then it compares the current with the previous and only does
system calls for cases that have been changed/added/deleted.
The nfsd threads do not need to be suspended until the comparison step is
being done. This results in a suspension period of milliseconds for a server
with 10000+ exported file systems.

There is some code using a LOGDEBUG() macro that allow runtime debugging
output via syslog(LOG_DEBUG,...) that can be enabled by creating a file
called /var/log/mountd.debug. This code is expected to be replaced with
code that uses dtrace by cy@ in the near future, once issues w.r.t. dtrace
in stable/12 have been resolved.

The patch should not change the usage of the exports file(s), but improves
the performance of reloading large exports file(s) where there are only a
small number of changes done to the file(s).

Tested by: pen@lysator.liu.se
PR: 237860
Reviewed by: kib
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D20487

4 years agoPut back MTREE_CMD here for now. Doh, not my day, perhaps.
sobomax [Mon, 3 Jun 2019 21:40:42 +0000 (21:40 +0000)]
Put back MTREE_CMD here for now. Doh, not my day, perhaps.

Reported by: markj, mav

4 years agoMFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
mav [Mon, 3 Jun 2019 20:55:52 +0000 (20:55 +0000)]
MFV r348585: 9683 Allow bypassing devid in vdev_disk_open()

illumos/illumos-gate@6fe4f3002ca33af5ab7123ed78d81899dadf2fbb

Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Pavel Zakharov <pavel.zakharov@delphix.com>

This is irrelevant to FreeBSD, just to reduce divergence.

4 years agoMFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
mav [Mon, 3 Jun 2019 20:49:20 +0000 (20:49 +0000)]
MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects

illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agoMFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly
mav [Mon, 3 Jun 2019 20:40:32 +0000 (20:40 +0000)]
MFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly

illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b

Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author:     Paul Dagnelie <pcd@delphix.com>

4 years agoMFV r348578: 9962 zil_commit should omit cache thrash
mav [Mon, 3 Jun 2019 20:24:40 +0000 (20:24 +0000)]
MFV r348578: 9962 zil_commit should omit cache thrash

illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoMFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush
mav [Mon, 3 Jun 2019 20:05:43 +0000 (20:05 +0000)]
MFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush

illumos/illumos-gate@f8fdf6812567ce1a3b76a6bee2ee3f04bd3fcaca

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Prakash Surya <prakash.surya@delphix.com>

4 years agoProperly define the fourth argument to ipf_check, the main entry point
cy [Mon, 3 Jun 2019 19:37:14 +0000 (19:37 +0000)]
Properly define the fourth argument to ipf_check, the main entry point
into ipfilter. A proper definition simplifies dtrace scripts a little.

MFC after: 1 week

4 years agoMFV r348573: 9993 zil writes can get delayed in zio pipeline
mav [Mon, 3 Jun 2019 19:25:53 +0000 (19:25 +0000)]
MFV r348573: 9993 zil writes can get delayed in zio pipeline

illumos/illumos-gate@2258ad0b755b24a55c6173b1e6bb6188389f72dd

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     George Wilson <george.wilson@delphix.com>

4 years agovery large dma mappings can cause integer overflow
tychon [Mon, 3 Jun 2019 19:19:35 +0000 (19:19 +0000)]
very large dma mappings can cause integer overflow

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20505

4 years agoMFV r348568: 9466 add JSON output support to channel programs
mav [Mon, 3 Jun 2019 19:15:06 +0000 (19:15 +0000)]
MFV r348568: 9466 add JSON output support to channel programs

illumos/illumos-gate@5267591016146502784860802129b16dab6f135c

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Alek Pinchuk <apinchuk@datto.com>

4 years ago[zfsboot] Fix boot env back compat (#190)
imp [Mon, 3 Jun 2019 19:10:46 +0000 (19:10 +0000)]
[zfsboot] Fix boot env back compat (#190)

* Fix boot env back compat

zfsboot must try zfsloader before loader in order to remain compatible
with boot environments created prior to zfs functionality being rolled
into loader proper.

* Improve comments in zfsboot

Explain the significance of the load path order, and put the comment
about looping through the paths in the appropriate scope.

Obtained From:  TrueNAS commit 4c60c62fcf0b6b6eac98ee8d46e7bbea64bc86f5
Submitted by: Ryan Moeller <ryan@freqlabs.com>

4 years agoMFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal
mav [Mon, 3 Jun 2019 19:03:24 +0000 (19:03 +0000)]
MFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal

illumos/illumos-gate@4e75ba682600b2bf19d158577d528c3db65050e8

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Serapheim Dimitropoulos <serapheim@delphix.com>

4 years agoMFC r348554: 9688 aggsum_fini leaks memory
mav [Mon, 3 Jun 2019 19:00:24 +0000 (19:00 +0000)]
MFC r348554: 9688 aggsum_fini leaks memory

illumos/illumos-gate@29bf2d68bef208274f5a54a14cc80c4a8cb76f53

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Paul Dagnelie <pcd@delphix.com>

4 years agoMFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()
mav [Mon, 3 Jun 2019 18:32:56 +0000 (18:32 +0000)]
MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()

illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agoMFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool
mav [Mon, 3 Jun 2019 17:56:44 +0000 (17:56 +0000)]
MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool

illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Serapheim Dimitropoulos <serapheim@delphix.com>

4 years agoMFV r348551: 9862 fix typo in comment in vdev_impl.h
mav [Mon, 3 Jun 2019 17:44:47 +0000 (17:44 +0000)]
MFV r348551: 9862 fix typo in comment in vdev_impl.h

illumos/illumos-gate@84927f52bd837f6e4882a19e43fd026f1828d910

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Allan Jude <allanjude@freebsd.org>

4 years agoMFV r348550: 1700 Add SCSI UNMAP support
mav [Mon, 3 Jun 2019 17:43:32 +0000 (17:43 +0000)]
MFV r348550: 1700 Add SCSI UNMAP support

illumos/illumos-gate@047c81d31d0f571d6652e97143cd15281de61e84

Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     Saso Kiselkov <saso.kiselkov@nexenta.com>

This is irrelevant to FreeBSD, just a diff reduction.

4 years agoMFV r348548: 9617 too-frequent TXG sync causes excessive write inflation
mav [Mon, 3 Jun 2019 17:40:11 +0000 (17:40 +0000)]
MFV r348548: 9617 too-frequent TXG sync causes excessive write inflation

illumos/illumos-gate@7928f4baf4ab3230557eb6289be68aa7a3003f38

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Matthew Ahrens <mahrens@delphix.com>

4 years agoMFV r348537: 8601 memory leak in get_special_prop()
mav [Mon, 3 Jun 2019 17:29:57 +0000 (17:29 +0000)]
MFV r348537: 8601 memory leak in get_special_prop()

illumos/illumos-gate@e19b450bec203d8be04447ea476d7a86b36d63a1

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author:     John Gallagher <john.gallagher@delphix.com>

4 years agoMFV r348535: 9677 panic from zio_write_gang_block() when creating dump device on...
mav [Mon, 3 Jun 2019 17:27:25 +0000 (17:27 +0000)]
MFV r348535: 9677 panic from zio_write_gang_block() when creating dump device on fragmented rpool

illumos/illumos-gate@7341a7de4f0489193e0cfe11049a7bcf1596a4db

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Brad Lewis <brad.lewis@delphix.com>

4 years agoMFV r348534: 9616 Bogus error when attempting to set property on read-only pool
mav [Mon, 3 Jun 2019 17:19:05 +0000 (17:19 +0000)]
MFV r348534: 9616 Bogus error when attempting to set property on read-only pool

illumos/illumos-gate@f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andrew Stormont <astormont@racktopsystems.com>

4 years agorpc.yppasswdd: Fix dirname(3) usage after r305952.
markj [Mon, 3 Jun 2019 16:51:07 +0000 (16:51 +0000)]
rpc.yppasswdd: Fix dirname(3) usage after r305952.

PR: 234972
Submitted by: Edward Fuhr <edward.fuhr@us.fujitsu.com> (original)
MFC after: 3 days

4 years agoTypo.
markj [Mon, 3 Jun 2019 16:47:00 +0000 (16:47 +0000)]
Typo.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agohwpmc_intel: List all Silvermont ids.
kib [Mon, 3 Jun 2019 16:21:09 +0000 (16:21 +0000)]
hwpmc_intel: List all Silvermont ids.

PR: 238310
Based on submission by: Masse Nicolas <nicolas.masse@stormshield.eu>
MFC after: 1 week

4 years agoWarn about deprecated features on all major OS versions.
jhb [Mon, 3 Jun 2019 15:43:40 +0000 (15:43 +0000)]
Warn about deprecated features on all major OS versions.

Reviewed by: imp
MFC after: 3 days
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20490

4 years agoAdd 'device cxgbe' explicitly in the synopsis.
jhb [Mon, 3 Jun 2019 15:41:54 +0000 (15:41 +0000)]
Add 'device cxgbe' explicitly in the synopsis.

ccr depends on symbols exported by the cxgbe driver as well as having
a runtime dependency.  While the runtime depenency was noted in the
manpage already, the compile-time dependency wasn't as clear.

PR: 238265
MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agoefirt efi_enter(): Release acquired locks and restore FPU ownership if
kib [Mon, 3 Jun 2019 15:41:45 +0000 (15:41 +0000)]
efirt efi_enter(): Release acquired locks and restore FPU ownership if
efi_arch_enter() returned an error.

Submitted: Jan Martin Mikkelsen <janm@transactionware.com>
MFC after: 1 week

4 years agoRollback the rest of the botched r348521. Re-work would be posted to
sobomax [Mon, 3 Jun 2019 15:34:00 +0000 (15:34 +0000)]
Rollback the rest of the botched r348521. Re-work would be posted to
reviews. Sorry.

Reported by: Enji Cooper

4 years agoamd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service.
kib [Mon, 3 Jun 2019 15:32:42 +0000 (15:32 +0000)]
amd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service.

If service code faulted, we might end up unwinding with interrupts
disabled.  Top-level kernel code should have interrupts enabled, which
is enforced by checks.

Save %rflags before entering EFI, and restore to the known good value
on return.  This handles situation with disabled interrupts on fault
and perhaps other potential bugs, e.g. invalid value for PSL_D.

Reported and tested by: Jan Martin Mikkelsen <janm@transactionware.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoRemove dead check.
kib [Mon, 3 Jun 2019 15:23:37 +0000 (15:23 +0000)]
Remove dead check.

We already handled the case when symstrindex < 0 at line 680.

Reported by: danfe using PVS-studio
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoRemove dead store.
kib [Mon, 3 Jun 2019 15:19:11 +0000 (15:19 +0000)]
Remove dead store.

sw_flags is set to the function argument several lines later.

Reported by: danfe using PVS-studio
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoLeave mtree hardcoded for now. Reverting partially 348521 and also
sobomax [Mon, 3 Jun 2019 15:12:44 +0000 (15:12 +0000)]
Leave mtree hardcoded for now. Reverting partially 348521 and also
the followup stopgap change, because I don't think it's a correct. I still
need to figure out where to stick it in. In cannot be in Makefile.inc1
and it cannot be in etc/Makefile from the looks of it to avoid
chicken-and-egg problem.

4 years agoStopgap fix to breakage from r348521.
imp [Mon, 3 Jun 2019 14:14:53 +0000 (14:14 +0000)]
Stopgap fix to breakage from r348521.

MTREE is defined, while MTREE_CMD isn't, use it instead.
This may not be 'right' but it fixes the CI and other issues.

Submitted by: Andreas Nilsson

4 years agopsm(4): Add natural scrolling support to sysmouse protocol
wulf [Mon, 3 Jun 2019 10:04:34 +0000 (10:04 +0000)]
psm(4): Add natural scrolling support to sysmouse protocol

This change enables natural scrolling with two finger scroll enabled
and when user is using a trackpad (mouse and trackpoint are not affected).
Depending on trackpad model it can be activated with setting of
hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl
values to 1.

Evdev protocol is not affected by this change too. Tune userland client
e.g. libinput to enable natural scrolling in that case.

Submitted by: nyan_myuji.xyz
Reviewed by: wulf
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20447

4 years agoAnother partial revert of r301289.
imp [Mon, 3 Jun 2019 05:25:22 +0000 (05:25 +0000)]
Another partial revert of r301289.

In this case, a change was made in one-true-awk from *FS to
getsval(fsloc) in a line just after one of the lines that had the 0 ->
NULL change. It works both ways as far as I can tell.  It looks like a
bug fix, but I've not tried to track down which ancient version of
one-true-awk it was in (github starts too late for tracking this
down). Before and after the changes the regression suite is passes
100% relative to the un-modified one-true-awk.

4 years agoFix mismerge that crept into r301289.
imp [Mon, 3 Jun 2019 05:25:16 +0000 (05:25 +0000)]
Fix mismerge that crept into r301289.

The conversion of 0 -> NULL required a rebase at some point, as noted
in r301289 when pfg commited it. In that rebase, three lines remained
that had been removed in a prior version of awk, and one of them had a
0 -> NULL change causing a conflict. The conflict should have been
resolved by removing the three lines, but wasn't. This introduces a
regression into f.split3 test which prior to this commit we were
failing, but a pure onetrueawk wasn't. Remove the offending 3 lines.

4 years agoRetire vm_reserv_extend_{contig,page}(). These functions were introduced
alc [Mon, 3 Jun 2019 05:15:36 +0000 (05:15 +0000)]
Retire vm_reserv_extend_{contig,page}().  These functions were introduced
as part of a false start toward fine-grained reservation locking.  In the
end, they were not needed, so eliminate them.

Order the parameters to vm_reserv_alloc_{contig,page}() consistently with
the vm_page functions that call them.

Update the comments about the locking requirements for
vm_reserv_alloc_{contig,page}().  They no longer require a free page
queues lock.

Wrap several lines that became too long after the "req" and "domain"
parameters were added to vm_reserv_alloc_{contig,page}().

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20492

4 years agoFix several places where tool name has been hardcoded:
sobomax [Sun, 2 Jun 2019 23:38:19 +0000 (23:38 +0000)]
Fix several places where tool name has been hardcoded:

    install -> ${INSTALL}
    mtree -> ${MTREE_CMD}
    services_mkdb -> ${SERVICES_MKDB_CMD}
    cap_mkdb -> ${CAP_MKDB_CMD}
    pwd_mkdb -> ${PWD_MKDB_CMD}
    kldxref -> ${KLDXREF_CMD}

If you do custom FreeBSD builds you may want to override those
in some cases.

Sponsored by: Sippy Software, Inc.

4 years agopsm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops
wulf [Sun, 2 Jun 2019 22:27:26 +0000 (22:27 +0000)]
psm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops

PR: 238291
Submitted by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
MFC after: 2 weeks

4 years agoRevert r348518
imp [Sun, 2 Jun 2019 20:52:21 +0000 (20:52 +0000)]
Revert r348518

It should not have happened. The change is actually in upstream and I misread the diffs.

4 years agoReapply r301691:
imp [Sun, 2 Jun 2019 20:47:15 +0000 (20:47 +0000)]
Reapply r301691:

Revert r301689 - one-true-awk: Avoid a NULL dereference.

I got this wrong and the coverity report doesn't match the NetBSD change,
which was thought for a different version.

The change wouldn't hurt but let's wait until upstream figures this out.

4 years agoThis should have been committed in r348511 with the awk update.
imp [Sun, 2 Jun 2019 16:44:50 +0000 (16:44 +0000)]
This should have been committed in r348511 with the awk update.

It was in my tree, the build worked, but I committed from contrib/one-true-awk
rather than the top level, so was omitted.

4 years agoMake tests(7) point people at the atf(7) man page.
trasz [Sun, 2 Jun 2019 16:33:24 +0000 (16:33 +0000)]
Make tests(7) point people at the atf(7) man page.

Other frameworks, such as googletest, should be added there as well,
once they become viable.  For now let's keep it simple.

Discussed with: ngie, emaste
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20124

4 years agoReapply r315426 by pfg:
imp [Sun, 2 Jun 2019 16:30:53 +0000 (16:30 +0000)]
Reapply r315426 by pfg:

|    MFV r315425: one-true-awk: have calloc(3) do the multiplication.

4 years agoReapply r301289 by pfg:
imp [Sun, 2 Jun 2019 16:28:20 +0000 (16:28 +0000)]
Reapply r301289 by pfg:

|    MFV r300961: one-true-awk: replace 0 with NULL for pointers
|    Also remove a redundant semicolon.
|    Also had to rebase on upstream pull.

4 years agoMerge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.git
imp [Sun, 2 Jun 2019 16:25:07 +0000 (16:25 +0000)]
Merge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.git

Note: this backs out a number of changes we've made to awk because
they aren't upstream, but are on the vendor branch. Those will be
reapplied. svn makes it needlessly difficult to know which ones, but
at least r315426, r301289, and maybe r301691, though there may be
others too. None of these are critical, so bisecting through this
point is safe for all but awk regression tests :).

4 years agobectl(8): Don't accept jid=0 from jail_getid
kevans [Sun, 2 Jun 2019 14:05:51 +0000 (14:05 +0000)]
bectl(8): Don't accept jid=0 from jail_getid

This will trivially exist, but we don't want it - none of our jailed BEs
will have jid=0.

MFC after: 3 days

4 years agojail_getid(3): add special-case immediate return for jid 0
kevans [Sun, 2 Jun 2019 14:03:56 +0000 (14:03 +0000)]
jail_getid(3): add special-case immediate return for jid 0

As depicted in the comment: jid 0 always exists, but the lookup will fail as
it does not appear in the kernel's alljails list being a special jail. Some
callers will expect/rely on this, and we have no reason to lie because it
does always exist.

Reported by: Stefan Hegnauer <stefan.hegnauer gmx ch>
MFC after: soon (regression, breaks inspecting jail host bits, partial
revert)

4 years agoImport latest one-true-awk from upstream
imp [Sun, 2 Jun 2019 04:23:56 +0000 (04:23 +0000)]
Import latest one-true-awk from upstream

Import git hash 4189ef5d from https://github.com/onetrueawk/awk.git as
there's not been a release in a while.

Upstream one-true-awk woke-up! Time to catch up. This may also revert
FreeBSD changes that we'd placed in the vendor branch in anticipation
of their inclusion in upstream. That's not yet the case, and these
will be resolved in the merge.

See FIXES for a complete list of bugs fixed (starting with the Jun 7,
2018 entry).

4 years agollvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG
kevans [Sun, 2 Jun 2019 04:04:21 +0000 (04:04 +0000)]
llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG

ASAN reports become a lot more useful with llvm-symbolizer in $PATH, and the
build is not much more time-consuming. The added benefit is that the
resulting reports will actually include symbol information; without, thread
trace information includes a bunch of addresses that immediately resolve to
an inline function in
^/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h and take a
little more effort to examine.

Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20484

4 years agogrep: Move lone 'r'grep case into the adjacent switch
kevans [Sun, 2 Jun 2019 02:38:44 +0000 (02:38 +0000)]
grep: Move lone 'r'grep case into the adjacent switch

This 'r' case should have belonged to the switch in the first place, but
I had somehow missed the switch when initially adding the rgrep link. The
zgrep script later came along and faithfully left this case standing alone,
so we will now go ahead and join it.

Nearby comment also adjusted a tad bit for wording and style.

Reported by: Daniel Ebdrup
MFC after: 3 days

4 years agoAdd a vm_page_wired() predicate.
markj [Sun, 2 Jun 2019 01:00:17 +0000 (01:00 +0000)]
Add a vm_page_wired() predicate.

Use it instead of accessing the wire_count field directly.  No
functional change intended.

Reviewed by: alc, kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20485

4 years agoAdd myself to committers-src.dot and calendar.freebsd
bdragon [Sun, 2 Jun 2019 00:08:24 +0000 (00:08 +0000)]
Add myself to committers-src.dot and calendar.freebsd

Approved by: jhibbits (mentor)

4 years agoPartially revert r271349, which disabled the msun cexp test #4 on i386.
dim [Sat, 1 Jun 2019 20:08:10 +0000 (20:08 +0000)]
Partially revert r271349, which disabled the msun cexp test #4 on i386.

Ensure the expected result is stored first in a volatile variable with
the desired type.  This makes all the tests succeed.

Slightly changed from the original pull request, but functionally the
same.

Obtained from: https://github.com/freebsd/freebsd/pull/401
Submitted by: Moritz Buhl <gh@moritzbuhl.de>
PR: 191676
MFC after: 3 days

4 years agoFix comment parsing in interp_simple.c
bcran [Sat, 1 Jun 2019 19:47:15 +0000 (19:47 +0000)]
Fix comment parsing in interp_simple.c

loader.rc has comment lines without a trailing space, which get
interpreted as commands. Avoid this by only matching against the
backslash character.

Reviewed by: imp, tsoome
Differential Revision: https://reviews.freebsd.org/D20491

4 years agolibatf: remove workaround not required after atf >= 0.18 update
emaste [Sat, 1 Jun 2019 18:26:07 +0000 (18:26 +0000)]
libatf: remove workaround not required after atf >= 0.18 update

lib/atf/libatf-c/tests/Makefile added the -Wno-duplicate-decl-specifier
due to an issue with an old version of ATF.  ATF has long since been
updated to a version with the fix so the workaround is no longer
necessary.

Found during review for PR 236889.

PR: 236889
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agooctusb: fix detach loop over USB ports
emaste [Sat, 1 Jun 2019 18:19:16 +0000 (18:19 +0000)]
octusb: fix detach loop over USB ports

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoDocument max_chains bump to 16384 at r330049.
mav [Sat, 1 Jun 2019 16:04:20 +0000 (16:04 +0000)]
Document max_chains bump to 16384 at r330049.

MFC after: 1 week

4 years agoSince a fatal trap can happen at aribtrary times, don't panic when the
imp [Sat, 1 Jun 2019 15:37:44 +0000 (15:37 +0000)]
Since a fatal trap can happen at aribtrary times, don't panic when the
completions are not in a consistent state. Cope with the different
places the normal I/O completion polling thread can be interrupted and
then re-entered during a kernel panic + dump.

Reviewed by: jhb and markj (both prior versions)
Differential Revision:  https://reviews.freebsd.org/D20478

4 years agoAfter parts of the locking fixes in r346595, syzkaller found
bz [Sat, 1 Jun 2019 14:57:42 +0000 (14:57 +0000)]
After parts of the locking fixes in r346595, syzkaller found
another one in udp_output(). This one is a race condition.
We do check on the laddr and lport without holding a lock in
order to determine whether we want a read or a write lock
(this is in the "sendto/sendmsg" cases where addr (sin) is given).

Instrumenting the kernel showed that after taking the lock, we
had bound to a local port from a parallel thread on the same socket.

If we find that case, unlock, and retry again. Taking the write
lock would not be a problem in first place (apart from killing some
parallelism). However the retry is needed as later on based on
similar condition checks we do acquire the pcbinfo lock and if the
conditions have changed, we might find ourselves with a lock
inconsistency, hence at the end of the function when trying to
unlock, hitting the KASSERT.

Reported by: syzbot+bdf4caa36f3ceeac198f@syzkaller.appspotmail.com
Reviewed by: markj
MFC after: 6 weeks
Event: Waterloo Hackathon 2019

4 years agoImprove error/debug messages in sdhci.c
bz [Sat, 1 Jun 2019 14:39:12 +0000 (14:39 +0000)]
Improve error/debug messages in sdhci.c

When starting a command also print the opcode and flags.
More consitently print flags as hex.
Use slot_printf rather than printf in one case.

MFC after: 6 weeks
Reviewed by: marius, kibab, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19748

4 years agocxgbe/t4_tom: adjust the hardware receive window to match changes to the
np [Sat, 1 Jun 2019 03:03:48 +0000 (03:03 +0000)]
cxgbe/t4_tom: adjust the hardware receive window to match changes to the
receive sockbuf's high water mark.

Calculate rx credits on the spot instead of tracking sbused/sb_cc and
rx_credits in the toepcb.  The previous method worked when the high
water mark changed due to SB_AUTOSIZE but not when it was adjusted
directly (for example, by the soreserve in nfsrvd_addsock).

This fixes a connection hang while running iozone over an NFS mounted
share where nfsd's TCP sockets are being handled by t4_tom.

MFC after: 3 days
Sponsored by: Chelsio Communications

4 years agopowerpc/moea: Fix moea64 native VA invalidation
jhibbits [Sat, 1 Jun 2019 01:40:14 +0000 (01:40 +0000)]
powerpc/moea: Fix moea64 native VA invalidation

Summary:
moea64_insert_pteg_native()'s invalidation only works by happenstance.
The purpose of the shifts and XORs is to extract the VSID in order to
reverse-engineer the lower bits of the VPN.  Currently a segment size is 256MB
(2**28), and ADDR_API_SHFT64 is 16, so ADDR_PIDX_SHIFT is equivalent.  However,
it's semantically incorrect, in that we don't want to shift by the page shift
size, we want to shift to get to the VSID.

Tested by: bdragon
Differential Revision: https://reviews.freebsd.org/D20467

4 years agorandom(4): Fix RANDOM_LOADABLE build
cem [Sat, 1 Jun 2019 01:22:21 +0000 (01:22 +0000)]
random(4): Fix RANDOM_LOADABLE build

I introduced an obvious compiler error in r346282, so this change fixes
that.

Unfortunately, RANDOM_LOADABLE isn't covered by our existing tinderbox, and
it seems like there were existing latent linking problems.  I believe these
were introduced on accident in r338324 during reduction of the boolean
expression(s) adjacent to randomdev.c and hash.c.  It seems the
RANDOM_LOADABLE build breakage has gone unnoticed for nine months.

This change correctly annotates randomdev.c and hash.c with !random_loadable
to match the pre-r338324 logic; and additionally updates the HWRNG drivers
in MD 'files.*', which depend on random_device symbols, with
!random_loadable (it is invalid for the kernel to depend on symbols from a
module).

(The expression for both randomdev.c and hash.c was the same, prior to
r338324: "optional random random_yarrow | random !random_yarrow
!random_loadable".  I.e., "random && (yarrow || !loadable)."  When Yarrow
was removed ("yarrow := False"), the expression was incorrectly reduced to
"optional random" when it should have retained "random && !loadable".)

Additionally, I discovered that virtio_random was missing a MODULE_DEPEND on
random_device, which breaks kld load/link of the driver on RANDOM_LOADABLE
kernels.  Address that issue as well.

PR: 238223
Reported by: Eir Nym <eirnym AT gmail.com>
Reviewed by: delphij, markm
Approved by: secteam(delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20466

4 years agoDefer evaluation of modified until after it's set
imp [Fri, 31 May 2019 22:57:20 +0000 (22:57 +0000)]
Defer evaluation of modified until after it's set

With the reorg r348175, we now look at modified before it is
set. Rearrange things so that we can set include_metadata to either
yes, no or if-modified. This should fix the -R flag that was broken in
r348175, which broke WITH_REPRODUCIBLE_BUILD for kernels.

Feedback From: emaste@
Differential Revision: https://reviews.freebsd.org/D20480

4 years agoThe function vm_phys_free_contig invokes vm_phys_free_pages for every
dougm [Fri, 31 May 2019 21:02:42 +0000 (21:02 +0000)]
The function vm_phys_free_contig invokes vm_phys_free_pages for every
power-of-two page block it frees, launching an unsuccessful search for
a buddy to pair up with each time.  The only possible buddy-up mergers
are across the boundaries of the freed region, so change
vm_phys_free_contig simply to enqueue the freed interior blocks, via a
new function vm_phys_enqueue_contig, and then call vm_phys_free_pages
on the bounding blocks to create as big a cross-boundary block as
possible after buddy-merging.

The only callers of vm_phys_free_contig at the moment call it in
situations where merging blocks across the boundary is clearly
impossible, so just call vm_phys_enqueue_contig in those places and
avoid trying to buddy-up at all.

One beneficiary of this change is in breaking reservations.  For the
case where memory is freed in breaking a reservation with only the
first and last pages allocated, the number of cycles consumed by the
operation drops about 11% with this change.

Suggested by: alc
Reviewed by: alc
Approved by: kib, markj (mentors)
Differential Revision: https://reviews.freebsd.org/D16901

4 years agoSimplify flow of pmap_demote_pde_locked() and add more comprehensive
kib [Fri, 31 May 2019 18:53:04 +0000 (18:53 +0000)]
Simplify flow of pmap_demote_pde_locked() and add more comprehensive
debugging checks.

In particular,
- Move the code to handle failure to allocate page table page into
  a helper.
- After the previous item is done, it is possible to distinguish !PG_A
  case and case of missed page, in the control flow.
- Make the variable to indicate that in-kernel mapping is demoted.
- Assert that missed page table page can only happen for in-kernel
  mapping when demoting direct map.
- If DIAGNOSTIC is enabled, and the page table page should be already
  filled, check all ptes instead of only first one.

Reviewed by: alc, markj
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D20266

4 years agoRevert r348438.
gjb [Fri, 31 May 2019 18:40:19 +0000 (18:40 +0000)]
Revert r348438.

The fix to override the default python version when building
the sysutils/py-google-compute-engine did not work, and there
are still issues that need to be addressed in the port itself.

See bugzilla 238267 for additional details.

MFC after: 6 days
MFC with: r348438
MFC note: no-op to appease the merge tracker
Sponsored by: The FreeBSD Foundation

4 years agonetdump: Buffer pages to avoid calling netdump_send() on each 4KB write.
markj [Fri, 31 May 2019 18:29:12 +0000 (18:29 +0000)]
netdump: Buffer pages to avoid calling netdump_send() on each 4KB write.

netdump waits for acknowledgement from the server for each write.  When
dumping page table pages, we perform many small writes, limiting
throughput.  Use the netdump client's buffer to buffer small contiguous
writes before calling netdump_send() to flush the MAXDUMPPGS-sized
buffer.  This results in a significant reduction in the time taken to
complete a netdump.

Submitted by: Sam Gwydir <sam@samgwydir.com>
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20317

4 years agoWhitespace cleanups, no functional change.
jhb [Fri, 31 May 2019 18:00:44 +0000 (18:00 +0000)]
Whitespace cleanups, no functional change.

4 years agostand: zfs: Free bouncebuf on error path in vdev_read
kevans [Fri, 31 May 2019 17:44:22 +0000 (17:44 +0000)]
stand: zfs: Free bouncebuf on error path in vdev_read

r344226 inadvertently added this path in which we return from failure on an
lseek and do not free bouncebuf on the way out.

MFC after: 3 days

4 years agoacpi_dock(4): Notify devd(8) on dock status change.
markj [Fri, 31 May 2019 15:44:33 +0000 (15:44 +0000)]
acpi_dock(4): Notify devd(8) on dock status change.

PR: 238138
Submitted by: Muhammad Kaisar Arkhan <hi@yukiisbo.red>
MFC after: 2 weeks

4 years agoRemove a redundant vm_page_remove() call.
markj [Fri, 31 May 2019 14:59:40 +0000 (14:59 +0000)]
Remove a redundant vm_page_remove() call.

vm_page_free_prep() removes the page from its object.  No functional
change intended.

Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20469

4 years agonewvers.sh correct typo from r348175
emaste [Fri, 31 May 2019 13:54:01 +0000 (13:54 +0000)]
newvers.sh correct typo from r348175

4 years agoRemove tests for the deprecated algorithms in r348206
lwhsu [Fri, 31 May 2019 04:29:29 +0000 (04:29 +0000)]
Remove tests for the deprecated algorithms in r348206

The tests are failing because the return value and output have changed, but
before test code structure adjusted, removing these test cases help people
be able to focus on more important cases.

Discussed with: emaste
MFC with: r348206
Sponsored by: The FreeBSD Foundation

4 years agoGet rid of extraneous initialization.
rmacklem [Fri, 31 May 2019 03:13:09 +0000 (03:13 +0000)]
Get rid of extraneous initialization.

Get rid of an extraneous initialization, mainly to keep a static analyser
happy. No semantic change.

PR: 238167
Submitted by: Alexey Dokuchaev

4 years agoReplace a single linked list with a hash table of lists.
rmacklem [Fri, 31 May 2019 01:28:48 +0000 (01:28 +0000)]
Replace a single linked list with a hash table of lists.

mountd.c uses a single linked list of "struct exportlist" structures,
where there is one of these for each exported file system on the NFS server.
This list gets long if there are a large number of file systems exported and
the list must be searched for each line in the exports file(s) when
SIGHUP causes the exports file(s) to be reloaded.
A simple benchmark that traverses SLIST() elements and compares two 32bit
fields in the structure for equal (which is what the search is)
appears to take a couple of nsec. So, for a server with 72000 exported file
systems, this can take about 5sec during reload of the exports file(s).
By replacing the single linked list with a hash table with a target of
10 elements per list, the time should be reduced to less than 1msec.
Peter Errikson (who has a server with 72000+ exported file systems) ran
a test program using 5 hashes to see how they worked.
fnv_32_buf(fsid,..., 0)
fnv_32_buf(fsid,..., FNV1_32_INIT)
hash32_buf(fsid,..., 0)
hash32_buf(fsid,..., HASHINIT)
- plus simply using the low order bits of fsid.val[0].
The first three behaved about equally well, with the first one being
slightly better than the others.
It has an average variation of about 4.5% about the target list length
and that is what this patch uses.
Peter Errikson also tested this hash table version and found that the
performance wasn't measurably improved by a larger hash table, so a
load factor of 10 appears adequate.

Tested by: pen@lysator.liu.se (with other patches)
PR: 237860
MFC after: 1 month

4 years agoClean up silly code case.
rmacklem [Fri, 31 May 2019 00:56:31 +0000 (00:56 +0000)]
Clean up silly code case.

This silly code segment has existed in the sources since it was brought
into FreeBSD 10 years ago. I honestly have no idea why this was done.
It was possible that I thought that it might have been better to not
set B_ASYNC for the "else" case, but I can't remember.
Anyhow, this patch gets rid of the if/else that does the same thing
either way, since it looks silly and upsets a static analyser.
This will have no semantic effect on the NFS client.

PR: 238167