[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zs6zaP52HRMQiWb1@infradead.org>
Date: Tue, 27 Aug 2024 22:19:36 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Haifeng Xu <haifeng.xu@...pee.com>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
tytso@....edu, yi.zhang@...weicloud.com, yukuai1@...weicloud.com,
tj@...nel.org, linux-ext4@...r.kernel.org,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] buffer: Associate the meta bio with blkg from buffer page
On Wed, Aug 28, 2024 at 11:32:24AM +0800, Haifeng Xu wrote:
> + } else if (buffer_meta(bh)) {
> + struct folio *folio;
> + struct cgroup_subsys_state *memcg_css, *blkcg_css;
> +
> + folio = page_folio(bh->b_page);
> + memcg_css = mem_cgroup_css_from_folio(folio);
> + if (cgroup_subsys_on_dfl(memory_cgrp_subsys) &&
> + cgroup_subsys_on_dfl(io_cgrp_subsys)) {
> + blkcg_css = cgroup_e_css(memcg_css->cgroup, &io_cgrp_subsys);
> + bio_associate_blkg_from_css(bio, blkcg_css);
> + }
I'll leave it to people more familiar with cgroups to decide if this
is the right thing to do, but if it is the code here should go into
a helper so that other metadata bio submitters can reuse it. That
helper also should have a good comment explaining it.
Powered by blists - more mailing lists