]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agostyle.9: Codify tolerance for eliding blank lines
Conrad Meyer [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

5 years agoEmulate the AMD MSR_LS_CFG MSR used for various Ryzen errata.
John Baldwin [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

5 years agor348590 had mention of "-I" in a comment that no longer applied to the patch.
Rick Macklem [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

5 years agoModify mountd so that it incrementally updates the kernel exports upon a reload.
Rick Macklem [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

5 years agoPut back MTREE_CMD here for now. Doh, not my day, perhaps.
Maxim Sobolev [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

5 years agoMFV r348585: 9683 Allow bypassing devid in vdev_disk_open()
Alexander Motin [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.

5 years ago9683 Allow bypassing devid in vdev_disk_open()
Alexander Motin [Mon, 3 Jun 2019 20:52:19 +0000 (20:52 +0000)]
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>

5 years agoMFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
Alexander Motin [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>

5 years ago9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects
Alexander Motin [Mon, 3 Jun 2019 20:45:48 +0000 (20:45 +0000)]
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>

5 years agoMFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly
Alexander Motin [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>

5 years ago9559 zfs diff handles files on delete queue in fromsnap poorly
Alexander Motin [Mon, 3 Jun 2019 20:39:13 +0000 (20:39 +0000)]
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>

5 years agoMFV r348578: 9962 zil_commit should omit cache thrash
Alexander Motin [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>

5 years ago9962 zil_commit should omit cache thrash
Alexander Motin [Mon, 3 Jun 2019 20:18:02 +0000 (20:18 +0000)]
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>

5 years agoMFV r348576: 9963 Seperate tunable for disabling ZIL vdev flush
Alexander Motin [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>

5 years ago9963 Seperate tunable for disabling ZIL vdev flush
Alexander Motin [Mon, 3 Jun 2019 19:53:39 +0000 (19:53 +0000)]
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>

5 years agoProperly define the fourth argument to ipf_check, the main entry point
Cy Schubert [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

5 years agoMFV r348573: 9993 zil writes can get delayed in zio pipeline
Alexander Motin [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>

5 years ago9993 zil writes can get delayed in zio pipeline
Alexander Motin [Mon, 3 Jun 2019 19:24:40 +0000 (19:24 +0000)]
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>

5 years ago9880 Race in ZFS parallel mount
Alexander Motin [Mon, 3 Jun 2019 19:20:10 +0000 (19:20 +0000)]
9880 Race in ZFS parallel mount

illumos/illumos-gate@bc4c0ff1343a311cc24933908ac6c4455af09031

Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author:     Andy Fiddaman <omnios@citrus-it.co.uk>

5 years agovery large dma mappings can cause integer overflow
Tycho Nightingale [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

5 years agoMFV r348568: 9466 add JSON output support to channel programs
Alexander Motin [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>

5 years ago[zfsboot] Fix boot env back compat (#190)
Warner Losh [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>

5 years ago9466 add JSON output support to channel programs
Alexander Motin [Mon, 3 Jun 2019 19:09:39 +0000 (19:09 +0000)]
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>

5 years agoMFV r348555: 9690 metaslab of vdev with no space maps was flushed during removal
Alexander Motin [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>

5 years agoMFC r348554: 9688 aggsum_fini leaks memory
Alexander Motin [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>

5 years agoMFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()
Alexander Motin [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>

5 years agoMFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool
Alexander Motin [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>

5 years agoMFV r348551: 9862 fix typo in comment in vdev_impl.h
Alexander Motin [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>

5 years agoMFV r348550: 1700 Add SCSI UNMAP support
Alexander Motin [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.

5 years agoMFV r348548: 9617 too-frequent TXG sync causes excessive write inflation
Alexander Motin [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>

5 years agoMFV r348537: 8601 memory leak in get_special_prop()
Alexander Motin [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>

5 years agoMFV r348535: 9677 panic from zio_write_gang_block() when creating dump device on...
Alexander Motin [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>

5 years agoMFV r348534: 9616 Bogus error when attempting to set property on read-only pool
Alexander Motin [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>

5 years ago9738 9112 broke third block copy allocations within one metaslab group
Alexander Motin [Mon, 3 Jun 2019 17:14:54 +0000 (17:14 +0000)]
9738 9112 broke third block copy allocations within one metaslab group

illumos/illumos-gate@b86e7e3f0e50748bb5bb5cc91632d72ff17f08dd

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author:     Alexander Motin <mav@FreeBSD.org>

5 years ago9690 metaslab of vdev with no space maps was flushed during removal
Alexander Motin [Mon, 3 Jun 2019 17:13:35 +0000 (17:13 +0000)]
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>

5 years ago9688 aggsum_fini leaks memory
Alexander Motin [Mon, 3 Jun 2019 17:11:26 +0000 (17:11 +0000)]
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>

5 years ago9681 ztest failure in spa_history_log_internal due to spa_rename()
Alexander Motin [Mon, 3 Jun 2019 17:08:49 +0000 (17:08 +0000)]
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>

5 years ago9682 page fault in dsl_async_clone_destroy() while opening pool
Alexander Motin [Mon, 3 Jun 2019 17:06:02 +0000 (17:06 +0000)]
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>

5 years ago9862 fix typo in comment in vdev_impl.h
Alexander Motin [Mon, 3 Jun 2019 17:02:35 +0000 (17:02 +0000)]
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>

5 years ago1700 Add SCSI UNMAP support
Alexander Motin [Mon, 3 Jun 2019 17:01:16 +0000 (17:01 +0000)]
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>

5 years ago9617 too-frequent TXG sync causes excessive write inflation
Alexander Motin [Mon, 3 Jun 2019 16:57:06 +0000 (16:57 +0000)]
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>

5 years agorpc.yppasswdd: Fix dirname(3) usage after r305952.
Mark Johnston [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

5 years agoTypo.
Mark Johnston [Mon, 3 Jun 2019 16:47:00 +0000 (16:47 +0000)]
Typo.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

5 years agohwpmc_intel: List all Silvermont ids.
Konstantin Belousov [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

5 years agoWarn about deprecated features on all major OS versions.
John Baldwin [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

5 years agoAdd 'device cxgbe' explicitly in the synopsis.
John Baldwin [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

5 years agoefirt efi_enter(): Release acquired locks and restore FPU ownership if
Konstantin Belousov [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

5 years agoRollback the rest of the botched r348521. Re-work would be posted to
Maxim Sobolev [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

5 years agoamd64 ef_rt_arch_call: Preserve %rflags around call into EFI RT service.
Konstantin Belousov [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

5 years ago8601 memory leak in get_special_prop()
Alexander Motin [Mon, 3 Jun 2019 15:25:12 +0000 (15:25 +0000)]
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>

5 years agoRemove dead check.
Konstantin Belousov [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

5 years ago9677 panic from zio_write_gang_block() when creating dump device on fragmented rpool
Alexander Motin [Mon, 3 Jun 2019 15:23:21 +0000 (15:23 +0000)]
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>

5 years ago9616 Bogus error when attempting to set property on read-only pool
Alexander Motin [Mon, 3 Jun 2019 15:19:23 +0000 (15:19 +0000)]
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>

5 years agoRemove dead store.
Konstantin Belousov [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

5 years agoLeave mtree hardcoded for now. Reverting partially 348521 and also
Maxim Sobolev [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.

5 years agoStopgap fix to breakage from r348521.
Warner Losh [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

5 years agopsm(4): Add natural scrolling support to sysmouse protocol
Vladimir Kondratyev [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

5 years agoAnother partial revert of r301289.
Warner Losh [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.

5 years agoFix mismerge that crept into r301289.
Warner Losh [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.

5 years agoRetire vm_reserv_extend_{contig,page}(). These functions were introduced
Alan Cox [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

5 years agoFix several places where tool name has been hardcoded:
Maxim Sobolev [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.

5 years agopsm(4): Add Elantech touchpad IC type 15 found on Thinkpad L480 laptops
Vladimir Kondratyev [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

5 years agoRevert r348518
Warner Losh [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.

5 years agoReapply r301691:
Warner Losh [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.

5 years agoThis should have been committed in r348511 with the awk update.
Warner Losh [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.

5 years agoMake tests(7) point people at the atf(7) man page.
Edward Tomasz Napierala [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

5 years agoReapply r315426 by pfg:
Warner Losh [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.

5 years agoReapply r301289 by pfg:
Warner Losh [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.

5 years agoMerge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.git
Warner Losh [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 :).

5 years agobectl(8): Don't accept jid=0 from jail_getid
Kyle Evans [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

5 years agojail_getid(3): add special-case immediate return for jid 0
Kyle Evans [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)

5 years agoImport latest one-true-awk from upstream
Warner Losh [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).

5 years agollvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG
Kyle Evans [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

5 years agogrep: Move lone 'r'grep case into the adjacent switch
Kyle Evans [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

5 years agoAdd a vm_page_wired() predicate.
Mark Johnston [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

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

Approved by: jhibbits (mentor)

5 years agoPartially revert r271349, which disabled the msun cexp test #4 on i386.
Dimitry Andric [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

5 years agoFix comment parsing in interp_simple.c
Rebecca Cran [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

5 years agolibatf: remove workaround not required after atf >= 0.18 update
Ed Maste [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

5 years agooctusb: fix detach loop over USB ports
Ed Maste [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

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

MFC after: 1 week

5 years agoSince a fatal trap can happen at aribtrary times, don't panic when the
Warner Losh [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

5 years agoAfter parts of the locking fixes in r346595, syzkaller found
Bjoern A. Zeeb [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

5 years agoImprove error/debug messages in sdhci.c
Bjoern A. Zeeb [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

5 years agocxgbe/t4_tom: adjust the hardware receive window to match changes to the
Navdeep Parhar [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

5 years agopowerpc/moea: Fix moea64 native VA invalidation
Justin Hibbits [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

5 years agorandom(4): Fix RANDOM_LOADABLE build
Conrad Meyer [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

5 years agoDefer evaluation of modified until after it's set
Warner Losh [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

5 years agoThe function vm_phys_free_contig invokes vm_phys_free_pages for every
Doug Moore [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

5 years agoSimplify flow of pmap_demote_pde_locked() and add more comprehensive
Konstantin Belousov [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

5 years agoRevert r348438.
Glen Barber [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

5 years agonetdump: Buffer pages to avoid calling netdump_send() on each 4KB write.
Mark Johnston [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

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

5 years agostand: zfs: Free bouncebuf on error path in vdev_read
Kyle Evans [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

5 years agoacpi_dock(4): Notify devd(8) on dock status change.
Mark Johnston [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

5 years agoRemove a redundant vm_page_remove() call.
Mark Johnston [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

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

5 years agoRemove tests for the deprecated algorithms in r348206
Li-Wen Hsu [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

5 years agoGet rid of extraneous initialization.
Rick Macklem [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

5 years agoReplace a single linked list with a hash table of lists.
Rick Macklem [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