mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-03 12:05:13 +02:00
NFS/localio: use GFP_NOIO and non-memreclaim workqueue in nfs_local_commit
nfslocaliod_workqueue is a non-memreclaim workqueue (it isn't initialized with WQ_MEM_RECLAIM), see commitb9f5dd57f4("nfs/localio: use dedicated workqueues for filesystem read and write"). Use nfslocaliod_workqueue for LOCALIO's SYNC work. Also, set PF_LOCAL_THROTTLE | PF_MEMALLOC_NOIO in nfs_local_fsync_work. Fixes:b9f5dd57f4("nfs/localio: use dedicated workqueues for filesystem read and write") Signed-off-by: Mike Snitzer <snitzer@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
committed by
Anna Schumaker
parent
67435d2d8a
commit
9bb0060f78
@@ -1056,17 +1056,22 @@ nfs_local_fsync_ctx_free(struct nfs_local_fsync_ctx *ctx)
|
||||
static void
|
||||
nfs_local_fsync_work(struct work_struct *work)
|
||||
{
|
||||
unsigned long old_flags = current->flags;
|
||||
struct nfs_local_fsync_ctx *ctx;
|
||||
int status;
|
||||
|
||||
ctx = container_of(work, struct nfs_local_fsync_ctx, work);
|
||||
|
||||
current->flags |= PF_LOCAL_THROTTLE | PF_MEMALLOC_NOIO;
|
||||
|
||||
status = nfs_local_run_commit(nfs_to->nfsd_file_file(ctx->localio),
|
||||
ctx->data);
|
||||
nfs_local_commit_done(ctx->data, status);
|
||||
if (ctx->done != NULL)
|
||||
complete(ctx->done);
|
||||
nfs_local_fsync_ctx_free(ctx);
|
||||
|
||||
current->flags = old_flags;
|
||||
}
|
||||
|
||||
static struct nfs_local_fsync_ctx *
|
||||
@@ -1090,7 +1095,7 @@ int nfs_local_commit(struct nfsd_file *localio,
|
||||
{
|
||||
struct nfs_local_fsync_ctx *ctx;
|
||||
|
||||
ctx = nfs_local_fsync_ctx_alloc(data, localio, GFP_KERNEL);
|
||||
ctx = nfs_local_fsync_ctx_alloc(data, localio, GFP_NOIO);
|
||||
if (!ctx) {
|
||||
nfs_local_commit_done(data, -ENOMEM);
|
||||
nfs_local_release_commit_data(localio, data, call_ops);
|
||||
@@ -1102,10 +1107,10 @@ int nfs_local_commit(struct nfsd_file *localio,
|
||||
if (how & FLUSH_SYNC) {
|
||||
DECLARE_COMPLETION_ONSTACK(done);
|
||||
ctx->done = &done;
|
||||
queue_work(nfsiod_workqueue, &ctx->work);
|
||||
queue_work(nfslocaliod_workqueue, &ctx->work);
|
||||
wait_for_completion(&done);
|
||||
} else
|
||||
queue_work(nfsiod_workqueue, &ctx->work);
|
||||
queue_work(nfslocaliod_workqueue, &ctx->work);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user