lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9cae20f9-aa6a-77da-8978-b4cfb7b0cb73@huaweicloud.com>
Date: Sat, 31 Aug 2024 14:11:08 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Tejun Heo <tj@...nel.org>, 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,
 linux-ext4@...r.kernel.org, linux-block@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
 "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH] buffer: Associate the meta bio with blkg from buffer page

Hi, Tejun!

在 2024/08/31 3:37, Tejun Heo 写道:
> Hello, Haifeng.
> 
> On Wed, Aug 28, 2024 at 11:32:24AM +0800, Haifeng Xu wrote:
> ...
>> The filesystem is ext4(ordered). The meta data can be written out by
>> writeback, but if there are too many dirty pages, we had to do
>> checkpoint to write out the meta data in current thread context.
>>
>> In this case, the blkg of thread1 has set io.max, so the j_checkpoint_mutex
>> can't be released and many threads must wait for it. However, the blkg from
>> buffer page didn' set any io policy. Therefore, for the meta buffer head,
>> we can associate the bio with blkg from the buffer page instead of current
>> thread context.
>>
>> Signed-off-by: Haifeng Xu <haifeng.xu@...pee.com>
>> ---
>>   fs/buffer.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/fs/buffer.c b/fs/buffer.c
>> index e55ad471c530..a7889f258d0d 100644
>> --- a/fs/buffer.c
>> +++ b/fs/buffer.c
>> @@ -2819,6 +2819,17 @@ static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
>>   	if (wbc) {
>>   		wbc_init_bio(wbc, bio);
>>   		wbc_account_cgroup_owner(wbc, bh->b_page, bh->b_size);
>> +	} 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 think the right way to do it is marking the bio with REQ_META and
> implement forced charging in blk-throtl similar to blk-iocost.

This is the exact thing I did in the code I attached in the other
thread, do you take a look?

https://lore.kernel.org/all/97fc38e6-a226-5e22-efc2-4405beb6d75b@huaweicloud.com/

Thanks,
Kuai
> 
> Thanks.
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ