From: Christoph Hellwig <hch@infradead.org>
To: Julian Sun <sunjunchao@bytedance.com>
Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
axboe@kernel.dk, hannes@cmpxchg.org, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeel.butt@linux.dev,
muchun.song@linux.dev, willy@infradead.org, jack@suse.cz,
tj@kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH v9 2/3] memcg,writeback: flush foreign bdev mappings separately from owner wbs
Date: Thu, 24 Sep 2026 23:55:16 -0700 [thread overview]
Message-ID: <arYa1DbKNeAN-PLl@infradead.org> (raw)
In-Reply-To: <20260925064444.3944820-3-sunjunchao@bytedance.com>
> +/*
> + * No extra memcg reference is taken: this work is embedded in the memcg,
> + * and mem_cgroup_css_free() waits for it to finish before freeing the memcg.
> + */
> +struct memcg_bdev_frn {
No reason not to spell out foreign here..
> + /* Reserve the slot: it may have become busy after the inflight check. */
Overly long line.
> + struct address_space *mapping = folio_mapping(folio);
> + struct inode *inode = mapping->host;
> +
> + if (memcg_bdev_frn_wq && sb_is_blkdev_sb(inode->i_sb)) {
Why do we need a NULL check for the workqueue here?
> memcg_wq = alloc_workqueue("memcg", WQ_PERCPU, 0);
> WARN_ON(!memcg_wq);
>
> +#ifdef CONFIG_CGROUP_WRITEBACK
> + memcg_bdev_frn_wq = alloc_workqueue("memcg_bdev_frn_flusher",
> + WQ_UNBOUND, 0);
> + WARN_ON(!memcg_bdev_frn_wq);
> +#endif
Instead please fail the boot. If we can't alloc a workqueue at
boot time, we're toast anyway.
next prev parent reply other threads:[~2026-09-25 6:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 6:44 [PATCH v9 0/3] memcg,writeback: flush foreign bdev mappings separately Julian Sun
2026-09-25 6:44 ` [PATCH v9 1/3] block: introduce bdev_flush_by_dev() Julian Sun
2026-09-25 6:52 ` Christoph Hellwig
2026-09-25 10:34 ` Jan Kara
2026-09-28 6:24 ` Christoph Hellwig
2026-09-28 9:51 ` Julian Sun
2026-10-02 11:10 ` Jan Kara
2026-10-05 8:26 ` Christoph Hellwig
2026-10-05 16:25 ` Jan Kara
2026-10-08 8:00 ` Julian Sun
2026-10-08 8:51 ` Jan Kara
2026-10-08 9:39 ` Christoph Hellwig
2026-10-02 9:23 ` Julian Sun
2026-10-05 8:27 ` Christoph Hellwig
2026-09-25 6:44 ` [PATCH v9 2/3] memcg,writeback: flush foreign bdev mappings separately from owner wbs Julian Sun
2026-09-25 6:55 ` Christoph Hellwig [this message]
2026-09-25 13:00 ` Julian Sun
2026-09-28 6:18 ` Christoph Hellwig
2026-09-25 6:44 ` [PATCH v9 3/3] writeback: add tracepoints for foreign bdev writeback Julian Sun
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=arYa1DbKNeAN-PLl@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=sunjunchao@bytedance.com \
--cc=tj@kernel.org \
--cc=willy@infradead.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