From: Tejun Heo <tj@kernel.org>
To: Junxiao Bi <junxiao.bi@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
gregkh@linuxfoundation.org
Subject: Re: [PATCH] kernfs: support kernfs notify in memory recliam context
Date: Tue, 14 Nov 2023 09:06:27 -1000 [thread overview]
Message-ID: <ZVPFMzHAx9JVz2ak@slm.duckdns.org> (raw)
In-Reply-To: <20231114185947.42829-1-junxiao.bi@oracle.com>
Hello,
On Tue, Nov 14, 2023 at 10:59:47AM -0800, Junxiao Bi wrote:
> kernfs notify is used in write path of md (md_write_start) to wake up
> userspace daemon, like "mdmon" for updating md superblock of imsm raid,
> md write will wait for that update done before issuing the write, if this
How is forward progress guarnateed for that userspace daemon? This sounds
like a really fragile setup.
> write is used for memory reclaim, the system may hung due to kernel notify
> can't be executed, that's because kernel notify is executed by "system_wq"
> which doesn't have a rescuer thread and kworker thread may not be created
> due to memory pressure, then userspace daemon can't be woke up and md write
> will hung.
>
> According Tejun, this can't be fixed by add RECLAIM to "system_wq" because
> that workqueue is shared and someone else might occupy that rescuer thread,
> to fix this from md side, have to replace kernfs notify with other way to
> communite with userspace daemon, that will break userspace interface,
> so use a separated workqueue for kernefs notify to allow it be used in
> memory reclaim context.
I'm not necessarily against the change but please go into a bit more details
on how and why it's structured this way and add a comment explaining
explaining who's depending on kernfs notify for reclaim forward progress.
Thanks.
--
tejun
next prev parent reply other threads:[~2023-11-14 19:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 18:59 [PATCH] kernfs: support kernfs notify in memory recliam context Junxiao Bi
2023-11-14 19:06 ` Tejun Heo [this message]
2023-11-14 20:09 ` junxiao.bi
2023-11-14 20:24 ` Tejun Heo
2023-11-14 23:53 ` junxiao.bi
2023-11-15 15:30 ` Mariusz Tkaczyk
2023-11-16 17:04 ` junxiao.bi
2023-11-17 8:36 ` Mariusz Tkaczyk
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=ZVPFMzHAx9JVz2ak@slm.duckdns.org \
--to=tj@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=junxiao.bi@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.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