]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: switch nfsiod to be an UNBOUND workqueue.
authorNeilBrown <neilb@suse.de>
Fri, 27 Nov 2020 00:24:33 +0000 (11:24 +1100)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 2 Dec 2020 19:05:54 +0000 (14:05 -0500)
commita0183f3ebde82698acc1475c85bdfd33d1236f9d
treeae6e8b7c11d2327352807f7ab6c25ddef122a992
parenta695ad2d6666c8175e91999a0290e6329b758329
NFS: switch nfsiod to be an UNBOUND workqueue.

nfsiod is currently a concurrency-managed workqueue (CMWQ).
This means that workitems scheduled to nfsiod on a given CPU are queued
behind all other work items queued on any CMWQ on the same CPU.  This
can introduce unexpected latency.

Occaionally nfsiod can even cause excessive latency.  If the work item
to complete a CLOSE request calls the final iput() on an inode, the
address_space of that inode will be dismantled.  This takes time
proportional to the number of in-memory pages, which on a large host
working on large files (e.g..  5TB), can be a large number of pages
resulting in a noticable number of seconds.

We can avoid these latency problems by switching nfsiod to WQ_UNBOUND.
This causes each concurrent work item to gets a dedicated thread which
can be scheduled to an idle CPU.

There is precedent for this as several other filesystems use WQ_UNBOUND
workqueue for handling various async events.

Signed-off-by: NeilBrown <neilb@suse.de>
Fixes: 687466e84cc3 ("workqueue: use WQ_MEM_RECLAIM instead of WQ_RESCUER")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/inode.c