From: "Zhou, Yun" <yun.zhou@windriver.com>
To: David Howells <dhowells@redhat.com>
Cc: pc@manguebit.org, netfs@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
hch@infradead.org
Subject: Re: [PATCH v2] netfs: fix writeback ENOMEM by using __GFP_NOFAIL for rolling buffer
Date: Mon, 27 Jul 2026 19:08:38 +0800 [thread overview]
Message-ID: <2e003306-e6cf-4b4e-a0cb-19beb1ea08d4@windriver.com> (raw)
In-Reply-To: <974342.1785146612@warthog.procyon.org.uk>
On 7/27/26 18:03, David Howells wrote:
> Yun Zhou <yun.zhou@windriver.com> wrote:
>
>> rolling_buffer_init() uses plain GFP_NOFS for its folio_queue allocation.
>> In the writeback path this can fail and trigger WARN_ON_ONCE(folio != NULL)
>> in netfs_writepages() when writeback_iter() returns additional dirty folios
>> left unhandled.
>>
>> Writeback must not fail with -ENOMEM. Fix this by adding a gfp_t parameter
>> to rolling_buffer_init() and passing GFP_NOFS | __GFP_NOFAIL from the
>> writeback path, ensuring the allocation always succeeds. Read paths
>> continue to use plain GFP_NOFS.
>
> I don't think this is the correct solution. I think you're right that a gfp_t
> needs to be passed into rolling_buffer*(), but I think we need a mempool as
> well.
>
> I have most of the patch for that, but I think I need adjust things so that
> the read path uses GFP_KERNEL, not GFP_NOFS.
>
Got it. Your mempool approach looks good. Please let me know if you need
anything from me.
BR,
Yun
prev parent reply other threads:[~2026-07-27 11:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 7:30 [PATCH v2] netfs: fix writeback ENOMEM by using __GFP_NOFAIL for rolling buffer Yun Zhou
2026-07-27 10:03 ` David Howells
2026-07-27 11:08 ` Zhou, Yun [this message]
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=2e003306-e6cf-4b4e-a0cb-19beb1ea08d4@windriver.com \
--to=yun.zhou@windriver.com \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.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