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: <b97810e9-c1bc-9198-c0d2-e132dde3e1f6@huaweicloud.com>
Date: Thu, 4 Jan 2024 20:22:34 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Jan Kara <jack@...e.cz>, Yu Kuai <yukuai1@...weicloud.com>
Cc: axboe@...nel.dk, roger.pau@...rix.com, colyli@...e.de,
 kent.overstreet@...il.com, joern@...ybastard.org, miquel.raynal@...tlin.com,
 richard@....at, vigneshr@...com, sth@...ux.ibm.com, hoeppner@...ux.ibm.com,
 hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
 jejb@...ux.ibm.com, martin.petersen@...cle.com, clm@...com,
 josef@...icpanda.com, dsterba@...e.com, viro@...iv.linux.org.uk,
 brauner@...nel.org, nico@...xnic.net, xiang@...nel.org, chao@...nel.org,
 tytso@....edu, adilger.kernel@...ger.ca, jack@...e.com,
 konishi.ryusuke@...il.com, willy@...radead.org, akpm@...ux-foundation.org,
 hare@...e.de, p.raghav@...sung.com, linux-block@...r.kernel.org,
 linux-kernel@...r.kernel.org, xen-devel@...ts.xenproject.org,
 linux-bcache@...r.kernel.org, linux-mtd@...ts.infradead.org,
 linux-s390@...r.kernel.org, linux-scsi@...r.kernel.org,
 linux-bcachefs@...r.kernel.org, linux-btrfs@...r.kernel.org,
 linux-fsdevel@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
 linux-ext4@...r.kernel.org, linux-nilfs@...r.kernel.org,
 yi.zhang@...wei.com, yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC v3 for-6.8/block 04/17] mtd: block2mtd: use bdev apis

Hi,

在 2024/01/04 19:28, Jan Kara 写道:
> On Thu 21-12-23 16:56:59, Yu Kuai wrote:
>> From: Yu Kuai <yukuai3@...wei.com>
>>
>> On the one hand covert to use folio while reading bdev inode, on the
>> other hand prevent to access bd_inode directly.
>>
>> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ...
>> +		for (p = folio_address(folio); p < max; p++)
>>   			if (*p != -1UL) {
>> -				lock_page(page);
>> -				memset(page_address(page), 0xff, PAGE_SIZE);
>> -				set_page_dirty(page);
>> -				unlock_page(page);
>> -				balance_dirty_pages_ratelimited(mapping);
>> +				folio_lock(folio);
>> +				memset(folio_address(folio), 0xff,
>> +				       folio_size(folio));
>> +				folio_mark_dirty(folio);
>> +				folio_unlock(folio);
>> +				bdev_balance_dirty_pages_ratelimited(bdev);
> 
> Rather then creating this bdev_balance_dirty_pages_ratelimited() just for
> MTD perhaps we can have here (and in other functions):
> 
> 				...
> 				mapping = folio_mapping(folio);
> 				folio_unlock(folio);
> 				if (mapping)
> 					balance_dirty_pages_ratelimited(mapping);
> 
> What do you think? Because when we are working with the folios it is rather
> natural to use their mapping for dirty balancing?

I think this is a great idea! And bdev_balance_dirty_pages_ratelimited()
can be removed as well.

Thanks,
Kuai

> 
> 								Honza
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ