Fix the default number of threads for Flex File layout pNFS client I/O.

The intent was that the default would be based on number of CPUs, but the
code disabled using taskqueue() by default.
This code is only executed when mounting a NFSv4.1 server that supports the
Flexible File layout for pNFS and, since such servers are rare, this change
shouldn't result in a POLA violation.
(The FreeBSD pNFS server is still a project and the only other one that
 uses Flexible File layout is being developed by Primary Data and I don't
 know if they have even shipped any to customers yet.)
Found while testing the pNFS server.
This commit is contained in:
Rick Macklem 2018-06-02 00:11:26 +00:00
parent 220e4623aa
commit dec8894b45
2 changed files with 5 additions and 3 deletions

View File

@ -90,7 +90,7 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nfscl_debuglevel,
0, "Debug level for NFS client");
SYSCTL_INT(_vfs_nfs, OID_AUTO, userhashsize, CTLFLAG_RDTUN, &nfsrv_lughashsize,
0, "Size of hash tables for uid/name mapping");
int nfs_pnfsiothreads = 0;
int nfs_pnfsiothreads = -1;
SYSCTL_INT(_vfs_nfs, OID_AUTO, pnfsiothreads, CTLFLAG_RW, &nfs_pnfsiothreads,
0, "Number of pNFS mirror I/O threads");
@ -723,6 +723,8 @@ nfs_pnfsio(task_fn_t *func, void *context)
pio = (struct pnfsio *)context;
if (pnfsioq == NULL) {
if (nfs_pnfsiothreads == 0)
return (EPERM);
if (nfs_pnfsiothreads < 0)
nfs_pnfsiothreads = mp_ncpus * 4;
pnfsioq = taskqueue_create("pnfsioq", M_WAITOK,
taskqueue_thread_enqueue, &pnfsioq);

View File

@ -6436,7 +6436,7 @@ nfsio_writedsmir(vnode_t vp, int *iomode, int *must_commit,
drpc->p = p;
drpc->inprog = 0;
ret = EIO;
if (nfs_pnfsiothreads > 0) {
if (nfs_pnfsiothreads != 0) {
ret = nfs_pnfsio(start_writedsmir, drpc);
NFSCL_DEBUG(4, "nfsio_writedsmir: nfs_pnfsio=%d\n", ret);
}
@ -6615,7 +6615,7 @@ nfsio_commitds(vnode_t vp, uint64_t offset, int cnt, struct nfsclds *dsp,
drpc->p = p;
drpc->inprog = 0;
ret = EIO;
if (nfs_pnfsiothreads > 0) {
if (nfs_pnfsiothreads != 0) {
ret = nfs_pnfsio(start_commitds, drpc);
NFSCL_DEBUG(4, "nfsio_commitds: nfs_pnfsio=%d\n", ret);
}