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: <aCxcpU_FBBQAguHR@li-dc0c254c-257c-11b2-a85c-98b6c1322444.ibm.com>
Date: Tue, 20 May 2025 16:12:45 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: Zhang Yi <yi.zhang@...weicloud.com>
Cc: linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, willy@...radead.org, tytso@....edu,
        adilger.kernel@...ger.ca, jack@...e.cz, yi.zhang@...wei.com,
        libaokun1@...wei.com, yukuai3@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH v2 6/8] ext4: make the writeback path support large folios

On Mon, May 12, 2025 at 02:33:17PM +0800, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@...wei.com>
> 
> In mpage_map_and_submit_buffers(), the 'lblk' is now aligned to
> PAGE_SIZE. Convert it to be aligned to folio size. Additionally, modify
> the wbc->nr_to_write update to reduce the number of pages in a single
> folio, ensuring that the entire writeback path can support large folios.
> 
Looks good, feel free to add:

Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>

Regards,
ojaswin

> Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
> ---
>  fs/ext4/inode.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 3e962a760d71..29eccdf8315a 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1942,7 +1942,7 @@ static int mpage_submit_folio(struct mpage_da_data *mpd, struct folio *folio)
>  		len = size & (len - 1);
>  	err = ext4_bio_write_folio(&mpd->io_submit, folio, len);
>  	if (!err)
> -		mpd->wbc->nr_to_write--;
> +		mpd->wbc->nr_to_write -= folio_nr_pages(folio);
>  
>  	return err;
>  }
> @@ -2165,7 +2165,6 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
>  
>  	start = mpd->map.m_lblk >> bpp_bits;
>  	end = (mpd->map.m_lblk + mpd->map.m_len - 1) >> bpp_bits;
> -	lblk = start << bpp_bits;
>  	pblock = mpd->map.m_pblk;
>  
>  	folio_batch_init(&fbatch);
> @@ -2176,6 +2175,7 @@ static int mpage_map_and_submit_buffers(struct mpage_da_data *mpd)
>  		for (i = 0; i < nr; i++) {
>  			struct folio *folio = fbatch.folios[i];
>  
> +			lblk = folio->index << bpp_bits;
>  			err = mpage_process_folio(mpd, folio, &lblk, &pblock,
>  						 &map_bh);
>  			/*
> @@ -2397,7 +2397,7 @@ static int mpage_journal_page_buffers(handle_t *handle,
>  	size_t len = folio_size(folio);
>  
>  	folio_clear_checked(folio);
> -	mpd->wbc->nr_to_write--;
> +	mpd->wbc->nr_to_write -= folio_nr_pages(folio);
>  
>  	if (folio_pos(folio) + len > size &&
>  	    !ext4_verity_in_progress(inode))
> -- 
> 2.46.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ