[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v3 for-6.8/block 04/17] mtd: block2mtd: use bdev apis
- To: Yu Kuai <yukuai1@xxxxxxxxxxxxxxx>
- From: Jan Kara <jack@xxxxxxx>
- Date: Thu, 4 Jan 2024 12:28:55 +0100
- Authentication-results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=wsQKzVwT; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=QnmhJ6W9
- Cc: axboe@xxxxxxxxx, roger.pau@xxxxxxxxxx, colyli@xxxxxxx, kent.overstreet@xxxxxxxxx, joern@xxxxxxxxxxxxxxx, miquel.raynal@xxxxxxxxxxx, richard@xxxxxx, vigneshr@xxxxxx, sth@xxxxxxxxxxxxx, hoeppner@xxxxxxxxxxxxx, hca@xxxxxxxxxxxxx, gor@xxxxxxxxxxxxx, agordeev@xxxxxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, clm@xxxxxx, josef@xxxxxxxxxxxxxx, dsterba@xxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, brauner@xxxxxxxxxx, nico@xxxxxxxxxxx, xiang@xxxxxxxxxx, chao@xxxxxxxxxx, tytso@xxxxxxx, adilger.kernel@xxxxxxxxx, jack@xxxxxxxx, konishi.ryusuke@xxxxxxxxx, willy@xxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, hare@xxxxxxx, p.raghav@xxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-bcachefs@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-erofs@xxxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, yukuai3@xxxxxxxxxx, yi.zhang@xxxxxxxxxx, yangerkun@xxxxxxxxxx
- Delivery-date: Thu, 04 Jan 2024 11:29:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu 21-12-23 16:56:59, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
...
> + 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?
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR
|