<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/nfsserver, branch release/9.3.0</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=release%2F9.3.0</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=release%2F9.3.0'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2014-05-09T00:28:07Z</updated>
<entry>
<title>MFC: r264888</title>
<updated>2014-05-09T00:28:07Z</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2014-05-09T00:28:07Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d89f5c395ed8f71b3806fa01ddfd24c7b1c98cbf'/>
<id>urn:sha1:d89f5c395ed8f71b3806fa01ddfd24c7b1c98cbf</id>
<content type='text'>
The PR reported that the old NFS server did not set uio_td == NULL
for the VOP_READ() call. This patch fixes both the old and new
server for this case.
</content>
</entry>
<entry>
<title>MFC r259765:</title>
<updated>2014-01-23T00:42:08Z</updated>
<author>
<name>Alexander Motin</name>
<email>mav@FreeBSD.org</email>
</author>
<published>2014-01-23T00:42:08Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d332000a67712ba0885336dae167eea90028ca9e'/>
<id>urn:sha1:d332000a67712ba0885336dae167eea90028ca9e</id>
<content type='text'>
Fix RPC server threads file handle affinity to work better with ZFS.

  Instead of taking 8 specific bytes of file handle to identify file during
RPC thread affitinity handling, use trivial hash of the full file handle.
ZFS's struct zfid_short does not have padding field after the length field,
as result, originally picked 8 bytes are loosing lower 16 bits of object ID,
causing many false matches and unneeded requests affinity to same thread.
  This fix substantially improves NFS server latency and scalability in SPEC
NFS benchmark by more flexible use of multiple NFS threads.
</content>
</entry>
<entry>
<title>MFC NFS FHA changes 249592 and 249596:</title>
<updated>2013-06-11T23:19:02Z</updated>
<author>
<name>Kenneth D. Merry</name>
<email>ken@FreeBSD.org</email>
</author>
<published>2013-06-11T23:19:02Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4e682b95e27b1e9ad6702eb0e78028b7490c52f7'/>
<id>urn:sha1:4e682b95e27b1e9ad6702eb0e78028b7490c52f7</id>
<content type='text'>
  ------------------------------------------------------------------------
  r249592 | ken | 2013-04-17 15:00:22 -0600 (Wed, 17 Apr 2013) | 180 lines

  Revamp the old NFS server's File Handle Affinity (FHA) code so that
  it will work with either the old or new server.

  The FHA code keeps a cache of currently active file handles for
  NFSv2 and v3 requests, so that read and write requests for the same
  file are directed to the same group of threads (reads) or thread
  (writes).  It does not currently work for NFSv4 requests.  They are
  more complex, and will take more work to support.

  This improves read-ahead performance, especially with ZFS, if the
  FHA tuning parameters are configured appropriately.  Without the
  FHA code, concurrent reads that are part of a sequential read from
  a file will be directed to separate NFS threads.  This has the
  effect of confusing the ZFS zfetch (prefetch) code and makes
  sequential reads significantly slower with clients like Linux that
  do a lot of prefetching.

  The FHA code has also been updated to direct write requests to nearby
  file offsets to the same thread in the same way it batches reads,
  and the FHA code will now also send writes to multiple threads when
  needed.

  This improves sequential write performance in ZFS, because writes
  to a file are now more ordered.  Since NFS writes (generally
  less than 64K) are smaller than the typical ZFS record size
  (usually 128K), out of order NFS writes to the same block can
  trigger a read in ZFS.  Sending them down the same thread increases
  the odds of their being in order.

  In order for multiple write threads per file in the FHA code to be
  useful, writes in the NFS server have been changed to use a LK_SHARED
  vnode lock, and upgrade that to LK_EXCLUSIVE if the filesystem
  doesn't allow multiple writers to a file at once.  ZFS is currently
  the only filesystem that allows multiple writers to a file, because
  it has internal file range locking.  This change does not affect the
  NFSv4 code.

  This improves random write performance to a single file in ZFS, since
  we can now have multiple writers inside ZFS at one time.

  I have changed the default tuning parameters to a 22 bit (4MB)
  window size (from 256K) and unlimited commands per thread as a
  result of my benchmarking with ZFS.

  The FHA code has been updated to allow configuring the tuning
  parameters from loader tunable variables in addition to sysctl
  variables.  The read offset window calculation has been slightly
  modified as well.  Instead of having separate bins, each file
  handle has a rolling window of bin_shift size.  This minimizes
  glitches in throughput when shifting from one bin to another.

  sys/conf/files:
  	Add nfs_fha_new.c and nfs_fha_old.c.  Compile nfs_fha.c
  	when either the old or the new NFS server is built.

  sys/fs/nfs/nfsport.h,
  sys/fs/nfs/nfs_commonport.c:
  	Bring in changes from Rick Macklem to newnfs_realign that
  	allow it to operate in blocking (M_WAITOK) or non-blocking
  	(M_NOWAIT) mode.

  sys/fs/nfs/nfs_commonsubs.c,
  sys/fs/nfs/nfs_var.h:
  	Bring in a change from Rick Macklem to allow telling
  	nfsm_dissect() whether or not to wait for mallocs.

  sys/fs/nfs/nfsm_subs.h:
  	Bring in changes from Rick Macklem to create a new
  	nfsm_dissect_nonblock() inline function and
  	NFSM_DISSECT_NONBLOCK() macro.

  sys/fs/nfs/nfs_commonkrpc.c,
  sys/fs/nfsclient/nfs_clkrpc.c:
  	Add the malloc wait flag to a newnfs_realign() call.

  sys/fs/nfsserver/nfs_nfsdkrpc.c:
  	Setup the new NFS server's RPC thread pool so that it will
  	call the FHA code.

  	Add the malloc flag argument to newnfs_realign().

  	Unstaticize newnfs_nfsv3_procid[] so that we can use it in
  	the FHA code.

  sys/fs/nfsserver/nfs_nfsdsocket.c:
  	In nfsrvd_dorpc(), add NFSPROC_WRITE to the list of RPC types
  	that use the LK_SHARED lock type.

  sys/fs/nfsserver/nfs_nfsdport.c:
  	In nfsd_fhtovp(), if we're starting a write, check to see
  	whether the underlying filesystem supports shared writes.
  	If not, upgrade the lock type from LK_SHARED to LK_EXCLUSIVE.

  sys/nfsserver/nfs_fha.c:
  	Remove all code that is specific to the NFS server
  	implementation.  Anything that is server-specific is now
  	accessed through a callback supplied by that server's FHA
  	shim in the new softc.

  	There are now separate sysctls and tunables for the FHA
  	implementations for the old and new NFS servers.  The new
  	NFS server has its tunables under vfs.nfsd.fha, the old
  	NFS server's tunables are under vfs.nfsrv.fha as before.

  	In fha_extract_info(), use callouts for all server-specific
  	code.  Getting file handles and offsets is now done in the
  	individual server's shim module.

  	In fha_hash_entry_choose_thread(), change the way we decide
  	whether two reads are in proximity to each other.
  	Previously, the calculation was a simple shift operation to
  	see whether the offsets were in the same power of 2 bucket.
  	The issue was that there would be a bucket (and therefore
  	thread) transition, even if the reads were in close
  	proximity.  When there is a thread transition, reads wind
  	up going somewhat out of order, and ZFS gets confused.

  	The new calculation simply tries to see whether the offsets
  	are within 1 &lt;&lt; bin_shift of each other.  If they are, the
  	reads will be sent to the same thread.

  	The effect of this change is that for sequential reads, if
  	the client doesn't exceed the max_reqs_per_nfsd parameter
  	and the bin_shift is set to a reasonable value (22, or
  	4MB works well in my tests), the reads in any sequential
  	stream will largely be confined to a single thread.

  	Change fha_assign() so that it takes a softc argument.  It
  	is now called from the individual server's shim code, which
  	will pass in the softc.

  	Change fhe_stats_sysctl() so that it takes a softc
  	parameter.  It is now called from the individual server's
  	shim code.  Add the current offset to the list of things
  	printed out about each active thread.

  	Change the num_reads and num_writes counters in the
  	fha_hash_entry structure to 32-bit values, and rename them
  	num_rw and num_exclusive, respectively, to reflect their
  	changed usage.

  	Add an enable sysctl and tunable that allows the user to
  	disable the FHA code (when vfs.XXX.fha.enable = 0).  This
  	is useful for before/after performance comparisons.

  nfs_fha.h:
  	Move most structure definitions out of nfs_fha.c and into
  	the header file, so that the individual server shims can
  	see them.

  	Change the default bin_shift to 22 (4MB) instead of 18
  	(256K).  Allow unlimited commands per thread.

  sys/nfsserver/nfs_fha_old.c,
  sys/nfsserver/nfs_fha_old.h,
  sys/fs/nfsserver/nfs_fha_new.c,
  sys/fs/nfsserver/nfs_fha_new.h:
  	Add shims for the old and new NFS servers to interface with
  	the FHA code, and callbacks for the

  	The shims contain all of the code and definitions that are
  	specific to the NFS servers.

  	They setup the server-specific callbacks and set the server
  	name for the sysctl and loader tunable variables.

  sys/nfsserver/nfs_srvkrpc.c:
  	Configure the RPC code to call fhaold_assign() instead of
  	fha_assign().

  sys/modules/nfsd/Makefile:
  	Add nfs_fha.c and nfs_fha_new.c.

  sys/modules/nfsserver/Makefile:
  	Add nfs_fha_old.c.

  Reviewed by:	rmacklem
  Sponsored by:	Spectra Logic

  ------------------------------------------------------------------------
  r249596 | ken | 2013-04-17 16:42:43 -0600 (Wed, 17 Apr 2013) | 7 lines

  Move the NFS FHA (File Handle Affinity) code from sys/nfsserver to
  sys/nfs, since it is now shared by the two NFS servers.

  Suggested by:	rmacklem
  Sponsored by:	Spectra Logic
  ------------------------------------------------------------------------

Sponsored by:	Spectra Logic
</content>
</entry>
<entry>
<title>MFC 245508,245566,245568,245611,245909:</title>
<updated>2013-02-28T21:57:38Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2013-02-28T21:57:38Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=2128bee20aed4ecf96fc57b0895a673f01dd8d9f'/>
<id>urn:sha1:2128bee20aed4ecf96fc57b0895a673f01dd8d9f</id>
<content type='text'>
Various fixes to timestamps in NFS:
- Use the VA_UTIMES_NULL flag to detect when NULL was passed to utimes()
  instead of comparing the desired time against the current time as a
  heuristic.
- Remove unused nfs_curusec().
- Use vfs_timestamp() to set file timestamps rather than invoking
  getmicrotime() or getnanotime() directly in NFS.
- Use NFSD_MONOSEC (which maps to time_uptime) instead of the seconds
  portion of wall-time stamps to manage timeouts on events.
- Remove unused nd_starttime from the per-request structure in the new
  NFS server.
- Use nanotime() for the modification time on a delegation to get as
  precise a time as possible.
- Use time_second instead of extracting the second from a call to
  getmicrotime().
</content>
</entry>
<entry>
<title>MFC r241025:</title>
<updated>2012-12-24T13:22:32Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-12-24T13:22:32Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3d143d01c147be00e8c501d8c703a980db533556'/>
<id>urn:sha1:3d143d01c147be00e8c501d8c703a980db533556</id>
<content type='text'>
Fix the mis-handling of the VV_TEXT on the nullfs vnodes.
Add a set of VOPs for the VV_TEXT query, set and clear operations,
which are correctly bypassed to lower vnode.
</content>
</entry>
<entry>
<title>MFC 228185:</title>
<updated>2012-01-05T18:50:12Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2012-01-05T18:50:12Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=362df807d05768cf1120a79c236449ab3beba962'/>
<id>urn:sha1:362df807d05768cf1120a79c236449ab3beba962</id>
<content type='text'>
Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.
</content>
</entry>
<entry>
<title>Fix the NFS servers so that they can do a Lookup of "..",</title>
<updated>2011-09-03T00:28:53Z</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2011-09-03T00:28:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=322c8d9e25b53243616d35f8fccd322ee26a129b'/>
<id>urn:sha1:322c8d9e25b53243616d35f8fccd322ee26a129b</id>
<content type='text'>
which requires that ni_strictrelative be set to 0, post-r224810.

Tested by:	swills (earlier version), geo dot liaskos at gmail.com
Approved by:	re (kib)
</content>
</entry>
<entry>
<title>Second-to-last commit implementing Capsicum capabilities in the FreeBSD</title>
<updated>2011-08-11T12:30:23Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2011-08-11T12:30:23Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a9d2f8d84f69e98100b5746816b35666bcf992ac'/>
<id>urn:sha1:a9d2f8d84f69e98100b5746816b35666bcf992ac</id>
<content type='text'>
kernel for FreeBSD 9.0:

Add a new capability mask argument to fget(9) and friends, allowing system
call code to declare what capabilities are required when an integer file
descriptor is converted into an in-kernel struct file *.  With options
CAPABILITIES compiled into the kernel, this enforces capability
protection; without, this change is effectively a no-op.

Some cases require special handling, such as mmap(2), which must preserve
information about the maximum rights at the time of mapping in the memory
map so that they can later be enforced in mprotect(2) -- this is done by
narrowing the rights in the existing max_protection field used for similar
purposes with file permissions.

In namei(9), we assert that the code is not reached from within capability
mode, as we're not yet ready to enforce namespace capabilities there.
This will follow in a later commit.

Update two capability names: CAP_EVENT and CAP_KEVENT become
CAP_POST_KEVENT and CAP_POLL_KEVENT to more accurately indicate what they
represent.

Approved by:	re (bz)
Submitted by:	jonathan
Sponsored by:	Google Inc
</content>
</entry>
<entry>
<title>Fix the kgssapi so that it can be loaded as a module. Currently</title>
<updated>2011-06-19T22:08:55Z</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2011-06-19T22:08:55Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7e7fd7d177c641879ad881c0d9011220fc384845'/>
<id>urn:sha1:7e7fd7d177c641879ad881c0d9011220fc384845</id>
<content type='text'>
the NFS subsystems use five of the rpcsec_gss/kgssapi entry points,
but since it was not obvious which others might be useful, all
nineteen were included. Basically the nineteen entry points are
set in a structure called rpc_gss_entries and inline functions
defined in sys/rpc/rpcsec_gss.h check for the entry points being
non-NULL and then call them. A default value is returned otherwise.
Requested by rwatson.

Reviewed by:	jhb
MFC after:	2 weeks
</content>
</entry>
<entry>
<title>Add a lock flags argument to the VFS_FHTOVP() file system</title>
<updated>2011-05-22T01:07:54Z</updated>
<author>
<name>Rick Macklem</name>
<email>rmacklem@FreeBSD.org</email>
</author>
<published>2011-05-22T01:07:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=694a586a43ad15e65a6fe278af031e4ec18a3524'/>
<id>urn:sha1:694a586a43ad15e65a6fe278af031e4ec18a3524</id>
<content type='text'>
method, so that callers can indicate the minimum vnode
locking requirement. This will allow some file systems to choose
to return a LK_SHARED locked vnode when LK_SHARED is specified
for the flags argument. This patch only adds the flag. It
does not change any file system to use it and all callers
specify LK_EXCLUSIVE, so file system semantics are not changed.

Reviewed by:	kib
</content>
</entry>
</feed>
