Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Arik Rinberg <ArikRinberg@google.com>
To: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	 Arik Rinberg <ArikRinberg@google.com>
Subject: [PATCH] NFS: flag files as supporting FMODE_NOWAIT
Date: Tue, 21 Apr 2026 06:53:49 +0000	[thread overview]
Message-ID: <20260421065350.2219737-1-ArikRinberg@google.com> (raw)

When opening a file in NFS, set FMODE_NOWAIT in filp->f_mode.

Without this flag, asynchronous I/O frameworks like io_uring assume
that the file system does not support non-blocking I/O. This causes
io_uring to punt all I/O operations to background io-wq worker threads
to avoid blocking the main ring. This results in performance
degredation.

By setting FMODE_NOWAIT, we inform the VFS that NFS supports
asynchronous I/O natively, keeping execution on the fast path and
restoring performance.

Link: https://github.com/axboe/liburing/issues/1499

Signed-off-by: Arik Rinberg <ArikRinberg@google.com>
---
 fs/nfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 5d08b6409c28..8e2100550f10 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -73,7 +73,7 @@ nfs_file_open(struct inode *inode, struct file *filp)
 
 	res = nfs_open(inode, filp);
 	if (res == 0)
-		filp->f_mode |= FMODE_CAN_ODIRECT;
+		filp->f_mode |= FMODE_CAN_ODIRECT | FMODE_NOWAIT;
 	return res;
 }
 
-- 
2.54.0.rc1.555.g9c883467ad-goog


                 reply	other threads:[~2026-04-21  6:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260421065350.2219737-1-ArikRinberg@google.com \
    --to=arikrinberg@google.com \
    --cc=anna@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).