freebsd-nq/sys
Rick Macklem 90d2dfab19 Merge the pNFS server code from projects/pnfs-planb-server into head.
This code merge adds a pNFS service to the NFSv4.1 server. Although it is
a large commit it should not affect behaviour for a non-pNFS NFS server.
Some documentation on how this works can be found at:
http://people.freebsd.org/~rmacklem/pnfs-planb-setup.txt
and will hopefully be turned into a proper document soon.
This is a merge of the kernel code. Userland and man page changes will
come soon, once the dust settles on this merge.
It has passed a "make universe", so I hope it will not cause build problems.
It also adds NFSv4.1 server support for the "current stateid".

Here is a brief overview of the pNFS service:
A pNFS service separates the Read/Write oeprations from all the other NFSv4.1
Metadata operations. It is hoped that this separation allows a pNFS service
to be configured that exceeds the limits of a single NFS server for either
storage capacity and/or I/O bandwidth.
It is possible to configure mirroring within the data servers (DSs) so that
the data storage file for an MDS file will be mirrored on two or more of
the DSs.
When this is used, failure of a DS will not stop the pNFS service and a
failed DS can be recovered once repaired while the pNFS service continues
to operate.  Although two way mirroring would be the norm, it is possible
to set a mirroring level of up to four or the number of DSs, whichever is
less.
The Metadata server will always be a single point of failure,
just as a single NFS server is.

A Plan B pNFS service consists of a single MetaData Server (MDS) and K
Data Servers (DS), all of which are recent FreeBSD systems.
Clients will mount the MDS as they would a single NFS server.
When files are created, the MDS creates a file tree identical to what a
single NFS server creates, except that all the regular (VREG) files will
be empty. As such, if you look at the exported tree on the MDS directly
on the MDS server (not via an NFS mount), the files will all be of size 0.
Each of these files will also have two extended attributes in the system
attribute name space:
pnfsd.dsfile - This extended attrbute stores the information that
    the MDS needs to find the data storage file(s) on DS(s) for this file.
pnfsd.dsattr - This extended attribute stores the Size, AccessTime, ModifyTime
    and Change attributes for the file, so that the MDS doesn't need to
    acquire the attributes from the DS for every Getattr operation.
For each regular (VREG) file, the MDS creates a data storage file on one
(or more if mirroring is enabled) of the DSs in one of the "dsNN"
subdirectories.  The name of this file is the file handle
of the file on the MDS in hexadecimal so that the name is unique.
The DSs use subdirectories named "ds0" to "dsN" so that no one directory
gets too large. The value of "N" is set via the sysctl vfs.nfsd.dsdirsize
on the MDS, with the default being 20.
For production servers that will store a lot of files, this value should
probably be much larger.
It can be increased when the "nfsd" daemon is not running on the MDS,
once the "dsK" directories are created.

For pNFS aware NFSv4.1 clients, the FreeBSD server will return two pieces
of information to the client that allows it to do I/O directly to the DS.
DeviceInfo - This is relatively static information that defines what a DS
             is. The critical bits of information returned by the FreeBSD
             server is the IP address of the DS and, for the Flexible
             File layout, that NFSv4.1 is to be used and that it is
             "tightly coupled".
             There is a "deviceid" which identifies the DeviceInfo.
Layout     - This is per file and can be recalled by the server when it
             is no longer valid. For the FreeBSD server, there is support
             for two types of layout, call File and Flexible File layout.
             Both allow the client to do I/O on the DS via NFSv4.1 I/O
             operations. The Flexible File layout is a more recent variant
             that allows specification of mirrors, where the client is
             expected to do writes to all mirrors to maintain them in a
             consistent state. The Flexible File layout also allows the
             client to report I/O errors for a DS back to the MDS.
             The Flexible File layout supports two variants referred to as
             "tightly coupled" vs "loosely coupled". The FreeBSD server always
             uses the "tightly coupled" variant where the client uses the
             same credentials to do I/O on the DS as it would on the MDS.
             For the "loosely coupled" variant, the layout specifies a
             synthetic user/group that the client uses to do I/O on the DS.
             The FreeBSD server does not do striping and always returns
             layouts for the entire file. The critical information in a layout
             is Read vs Read/Writea and DeviceID(s) that identify which
             DS(s) the data is stored on.

At this time, the MDS generates File Layout layouts to NFSv4.1 clients
that know how to do pNFS for the non-mirrored DS case unless the sysctl
vfs.nfsd.default_flexfile is set non-zero, in which case Flexible File
layouts are generated.
The mirrored DS configuration always generates Flexible File layouts.
For NFS clients that do not support NFSv4.1 pNFS, all I/O operations
are done against the MDS which acts as a proxy for the appropriate DS(s).
When the MDS receives an I/O RPC, it will do the RPC on the DS as a proxy.
If the DS is on the same machine, the MDS/DS will do the RPC on the DS as
a proxy and so on, until the machine runs out of some resource, such as
session slots or mbufs.
As such, DSs must be separate systems from the MDS.

Tested by:	james.rose@framestore.com
Relnotes:	yes
2018-06-12 19:36:32 +00:00
..
amd64 Fix braino in r334799. Maxmem is in pages. 2018-06-11 15:28:20 +00:00
arm hwpmc: remove hwpmc_xscale.c from corresponding arm build 2018-06-08 18:24:46 +00:00
arm64 Add a driver for the BCM2835 Mini-UART as seen on the RPi3 2018-06-12 13:26:31 +00:00
bsm
cam Enable high-speed on the card before increasing frequency on the controller 2018-06-05 11:03:24 +00:00
cddl This originated from ZFS On Linux, as 2018-06-08 17:38:28 +00:00
compat Implement the ip_eth_mc_map() function in the LinuxKPI. 2018-06-12 08:43:49 +00:00
conf o Add driver for PLIC (Platform-Level Interrupt Controller) device. 2018-06-12 17:45:15 +00:00
contrib [ath_hal] Return failure if noise floor calibration fails. 2018-06-08 18:21:57 +00:00
crypto disable printing value of SKEIN_LOOP during standard out, 2018-05-19 18:27:14 +00:00
ddb Extend show proc with reaper, sigparent, and vmspace information 2018-05-25 13:59:48 +00:00
dev Rework PSCI so it only searches for the call function once. 2018-06-12 14:54:17 +00:00
dts arm: overlays: Update to new path-based sugar format 2018-05-04 14:38:48 +00:00
fs Merge the pNFS server code from projects/pnfs-planb-server into head. 2018-06-12 19:36:32 +00:00
gdb
geom Introduce the 'n' flag for the geli attach command. 2018-05-09 20:53:38 +00:00
gnu gnu/dts: Update our copy of arm dts from Linux 4.16 2018-04-20 19:37:08 +00:00
i386 All exceptions IDT descriptors must use interrupt gates on 4/4 kernel. 2018-06-12 10:43:20 +00:00
isa Revert r330780, it was improperly tested and results in taking a spin 2018-03-11 20:13:15 +00:00
kern makesyscalls: simplify capenabled pipeline 2018-06-11 18:57:40 +00:00
kgssapi
libkern str(r)chr: Replace union abuse with __DECONST 2018-06-04 18:47:14 +00:00
mips hwpmc: yet another missed fixup 2018-06-08 18:54:47 +00:00
modules linux64: use linux output target for linux_vdso.so 2018-06-12 13:32:42 +00:00
net Fix a memory leak for the BIOCSETWF ioctl on kernels with the BPF_JITTER 2018-06-11 23:32:06 +00:00
net80211 Use an accessor function to access ifr_data. 2018-03-30 18:50:13 +00:00
netgraph Catch up two more places to the V_ifnet change to a CK_STAILQ. 2018-05-24 00:06:55 +00:00
netinet Change RACK dependency on TCPHPTS from a build-time dependency to a load- 2018-06-11 14:27:19 +00:00
netinet6 Load balance sockets with new SO_REUSEPORT_LB option. 2018-06-06 15:45:57 +00:00
netipsec uma: implement provisional api for per-cpu zones 2018-06-08 21:40:03 +00:00
netpfil pf: Fix deadlock with route-to 2018-06-09 14:17:06 +00:00
netsmb Eliminate the overhead of gratuitous repeated reinitialization of cap_rights 2018-05-09 18:47:24 +00:00
nfs Merge the pNFS server code from projects/pnfs-planb-server into head. 2018-06-12 19:36:32 +00:00
nfsclient
nfsserver
nlm
ofed UDP: further performance improvements on tx 2018-05-23 21:02:14 +00:00
opencrypto cryptosoft: Do not exceed crd_len around *crypt_multi 2018-04-19 15:24:21 +00:00
powerpc hwpmc: simplify calling convention for hwpmc interrupt handling 2018-06-08 04:58:03 +00:00
riscv Include VirtIO devices to the GENERIC configuration file. 2018-06-12 17:55:40 +00:00
rpc
security #include <bsm/audit.h> in security/audit/audit_ioctl.h 2018-05-30 21:50:23 +00:00
sparc64 Define memmove and make bcopy alt entry point 2018-05-24 21:11:28 +00:00
sys Revert r334929 2018-06-10 19:15:38 +00:00
teken teken: Fix sequences header which was crossing the 80-col boundary 2018-05-29 08:41:44 +00:00
tests epoch(9): Make epochs non-preemptible by default 2018-05-18 17:29:43 +00:00
tools Add dtb overlays support 2018-03-24 21:30:24 +00:00
ufs ufs: remove cgbno variable where unused 2018-05-19 19:30:42 +00:00
vm uma: implement provisional api for per-cpu zones 2018-06-08 21:40:03 +00:00
x86 Untangle configuration ifdefs a little. On x86, msi is optional on pci, 2018-06-10 14:49:13 +00:00
xdr
xen xen: remove dead code from gnttab.h 2018-05-25 08:44:00 +00:00
Makefile