Re: [PATCH] buffer: Associate the meta bio with blkg from buffer page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux