FreeBSD src
Go to file
Rick Macklem 0f0869bca3 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
2019-06-03 22:58:51 +00:00
bin Convert freebsd-version to using -v 2019-05-23 17:19:00 +00:00
cddl MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects 2019-06-03 20:49:20 +00:00
contrib Another partial revert of r301289. 2019-06-03 05:25:22 +00:00
crypto Complete LOCAL_PEERCRED support. Cache pid of the remote process in the 2019-05-30 14:24:26 +00:00
etc Put back MTREE_CMD here for now. Doh, not my day, perhaps. 2019-06-03 21:40:42 +00:00
gnu [PPC] Enable build/install of ld.bfd on base 2019-05-20 16:00:32 +00:00
include Import OpenSSL 1.1.1c. 2019-05-28 20:08:17 +00:00
kerberos5 Add WITH_PIE knob to build Position Independent Executables 2019-02-15 22:22:38 +00:00
lib 9559 zfs diff handles files on delete queue in fromsnap poorly 2019-06-03 20:39:13 +00:00
libexec Correctly align usage: output 2019-05-25 11:22:49 +00:00
release Revert r348438. 2019-05-31 18:40:19 +00:00
rescue rescue: set NO_SHARED in Makefile 2018-11-19 22:18:18 +00:00
sbin bectl(8): Don't accept jid=0 from jail_getid 2019-06-02 14:05:51 +00:00
secure Merge OpenSSL 1.1.1c. 2019-05-28 21:54:12 +00:00
share Add 'device cxgbe' explicitly in the synopsis. 2019-06-03 15:41:54 +00:00
stand [zfsboot] Fix boot env back compat (#190) 2019-06-03 19:10:46 +00:00
sys MFV r348585: 9683 Allow bypassing devid in vdev_disk_open() 2019-06-03 20:55:52 +00:00
targets Remove kgzip and kgzldr. 2019-05-24 05:34:21 +00:00
tests Remove tests for the deprecated algorithms in r348206 2019-05-31 04:29:29 +00:00
tools llvm-symbolizer: Move out of CLANG_EXTRAS, into CLANG 2019-06-02 04:04:21 +00:00
usr.bin Fix several places where tool name has been hardcoded: 2019-06-02 23:38:19 +00:00
usr.sbin Modify mountd so that it incrementally updates the kernel exports upon a reload. 2019-06-03 22:58:51 +00:00
.arcconfig callsign isn't required anymore 2016-09-29 06:19:45 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml Cirrus-CI: pass OVMF env var to test script for upcoming changes 2019-04-11 13:01:26 +00:00
.gitattributes MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel 2019-01-05 22:45:20 +00:00
.gitignore Ignore _.universe-toolchain file. 2018-07-01 13:50:37 +00:00
COPYRIGHT Happy New Year 2019! 2019-01-01 00:25:25 +00:00
LOCKS LOCKS: update current locks 2018-06-09 03:08:04 +00:00
MAINTAINERS Update/reformat maintainer entries that I am a part of 2019-04-29 18:48:43 +00:00
Makefile Modernize the MAKE_JUST_KERNELS hint in the top-level makefile. 2019-05-24 15:45:43 +00:00
Makefile.inc1 Rollback the rest of the botched r348521. Re-work would be posted to 2019-06-03 15:34:00 +00:00
Makefile.libcompat Use ...-freebsd13.0 in -target strings. 2018-11-12 16:55:20 +00:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc Remove kgzip and kgzldr. 2019-05-24 05:34:21 +00:00
README Import OpenSSL 1.1.1c. 2019-05-28 20:08:17 +00:00
README.md README: add generic notes about GENERIC and NOTES 2018-06-17 19:44:24 +00:00
UPDATING Move back group, master.passwd and shells to etc directory 2019-05-23 18:37:05 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory. This file was last revised on: FreeBSD

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html, and https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html for more information, including setting make(1) variables.

Source Roadmap:

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

stand		Boot loader sources.

sys		Kernel sources.

sys/<arch>/conf Kernel configuration files. GENERIC is the configuration
		used in release builds. NOTES contains documentation of
		all possible entries.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/current-stable.html