From: Andrew Morton <akpm@linux-foundation.org>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Heming Zhao <heming.zhao@suse.com>, Mark Fasheh <mark@fasheh.com>,
Joel Becker <jlbec@evilplan.org>,
ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] ocfs2: cluster: use GFP_NOFS for heartbeat bio allocation
Date: Fri, 10 Jul 2026 17:26:29 -0700 [thread overview]
Message-ID: <20260710172629.46dcd01fc4132e876b92d2f0@linux-foundation.org> (raw)
In-Reply-To: <20260710071756.3586797-1-joseph.qi@linux.alibaba.com>
On Fri, 10 Jul 2026 15:17:55 +0800 Joseph Qi <joseph.qi@linux.alibaba.com> wrote:
> o2hb_setup_one_bio() allocates the heartbeat bio with GFP_ATOMIC. The
> disk heartbeat runs in the o2hb kernel thread (o2hb_do_disk_heartbeat),
> which is process context and can sleep, so there is no atomicity
> requirement here.
>
> GFP_ATOMIC lacks __GFP_DIRECT_RECLAIM, so the allocation is not served
> from the fs_bio_set mempool reserve and can return NULL under memory
> pressure. A failed heartbeat allocation aborts the heartbeat and can
> lead to the local node being fenced, which is exactly what the old
> comment worried about.
>
> Use GFP_NOFS instead. It keeps __GFP_DIRECT_RECLAIM so the allocation is
> backed by the fs_bio_set mempool and cannot fail, while avoiding
> recursion back into the filesystem during heartbeat I/O. As the
> allocation can no longer fail, drop the dead ERR_PTR(-ENOMEM) path in
> o2hb_setup_one_bio() and the now-redundant IS_ERR() handling in its
> callers.
fyi, AI review asked a thing:
https://sashiko.dev/#/patchset/20260710071756.3586797-1-joseph.qi@linux.alibaba.com
prev parent reply other threads:[~2026-07-11 0:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-10 7:17 [PATCH 1/2] ocfs2: cluster: use GFP_NOFS for heartbeat bio allocation Joseph Qi
2026-07-10 7:17 ` [PATCH 2/2] ocfs2: cluster: use an on-stack bio for the heartbeat write Joseph Qi
2026-07-11 0:26 ` Andrew Morton [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=20260710172629.46dcd01fc4132e876b92d2f0@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=heming.zhao@suse.com \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
/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