public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chuck Lever <cel@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Mike Snitzer <snitzer@kernel.org>,
	linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [RFC PATCH 2/2] NFSD: Add asynchronous write throttling support
Date: Wed, 7 Jan 2026 09:00:57 +0100	[thread overview]
Message-ID: <20260107080057.GB19005@lst.de> (raw)
In-Reply-To: <20251219141105.1247093-3-cel@kernel.org>

On Fri, Dec 19, 2025 at 09:11:05AM -0500, Chuck Lever wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
> 
> When memory pressure occurs during buffered writes, the traditional
> approach is for balance_dirty_pages() to put the writing thread to
> sleep until dirty pages are flushed. For NFSD, this means server
> threads block waiting for I/O, reducing overall server throughput.
> 
> Add support for asynchronous write throttling using the BDP_ASYNC
> flag to balance_dirty_pages_ratelimited_flags(). When enabled via:
> 
>   /sys/kernel/debug/nfsd/write_async_throttle

Let me reiterate that I really, really hate all this magic debugs-fs
enabled features.  Either they are gnuinely useful (think this would
be such a thing) and they should be enabled unconditionally, or they
are tradeoffs and should have a proper tunable not hidden in debugfs.

> NFSD checks memory pressure before attempting buffered writes. If
> balance_dirty_pages_ratelimited_flags() returns -EAGAIN (indicating
> memory exhaustion), NFSD returns NFS4ERR_DELAY (or NFSERR_JUKEBOX for
> NFSv3) to the client instead of blocking.
> 
> This allows clients to back off and retry rather than having server
> threads tied up waiting for writeback. The setting defaults to 0
> (synchronous throttling) and can be combined with write_throttle for
> layered throttling strategies.
> 
> Note: NFSv2 does not support NFSERR_JUKEBOX, so async throttling is
> automatically disabled for NFSv2 requests regardless of the setting.

This all seems very useful to me.  But it really needs to show numbers
on how it helps.

> + * Contents:
> + *   %0: Synchronous throttling (default) - writes sleep in balance_dirty_pages()

Overly lone line.


  reply	other threads:[~2026-01-07  8:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 14:11 [RFC PATCH 0/2] NFSD: Rate-limiting unstable WRITEs Chuck Lever
2025-12-19 14:11 ` [RFC PATCH 1/2] NFSD: Add aggressive write throttling control Chuck Lever
2026-01-07  7:55   ` Christoph Hellwig
2026-01-07 14:36     ` Chuck Lever
2026-01-07 14:42       ` Christoph Hellwig
2026-01-07 14:49         ` Chuck Lever
2025-12-19 14:11 ` [RFC PATCH 2/2] NFSD: Add asynchronous write throttling support Chuck Lever
2026-01-07  8:00   ` Christoph Hellwig [this message]
2026-01-07 14:42     ` Chuck Lever
2026-01-07 16:25       ` Christoph Hellwig
2026-01-07 19:40       ` Mike Snitzer

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=20260107080057.GB19005@lst.de \
    --to=hch@lst.de \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=snitzer@kernel.org \
    /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