From: Vishal Moola <vishal.moola@gmail.com>
To: linux-mm@kvack.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-ext4@vger.kernel.org, akpm@linux-foundation.org,
willy@infradead.org, naoya.horiguchi@nec.com, tytso@mit.edu
Subject: Re: [PATCH v2 1/4] ext4: Convert move_extent_per_page() to use folios
Date: Thu, 17 Nov 2022 23:28:21 -0800 [thread overview]
Message-ID: <CAOzc2pxYSpQGEEads3qfxyJgdcDzMoEyTg01Z3D2ZaAjUSOznw@mail.gmail.com> (raw)
In-Reply-To: <20221118021410.24420-2-vishal.moola@gmail.com>
On Thu, Nov 17, 2022 at 6:14 PM Vishal Moola (Oracle)
<vishal.moola@gmail.com> wrote:
>
> Converts move_extent_per_page() to use folios. This change removes
> 5 calls to compound_head() and is in preparation for the removal of
> the try_to_release_page() wrapper.
>
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> ---
> fs/ext4/move_extent.c | 52 ++++++++++++++++++++++++++-----------------
> 1 file changed, 31 insertions(+), 21 deletions(-)
>
> diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
> index 044e34cd835c..aa67eb240ca6 100644
> --- a/fs/ext4/move_extent.c
> +++ b/fs/ext4/move_extent.c
> @@ -253,6 +253,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
> {
> struct inode *orig_inode = file_inode(o_filp);
> struct page *pagep[2] = {NULL, NULL};
> + struct folio *folio[2] = {NULL, NULL};
> handle_t *handle;
> ext4_lblk_t orig_blk_offset, donor_blk_offset;
> unsigned long blocksize = orig_inode->i_sb->s_blocksize;
> @@ -313,6 +314,13 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
> * hold page's lock, if it is still the case data copy is not
> * necessary, just swap data blocks between orig and donor.
> */
> + folio[0] = page_folio(pagep[0]);
> + folio[1] = page_folio(pagep[1]);
> +
> + VM_BUG_ON_FOLIO(!folio_test_large(folio[0]), folio[0]);
> + VM_BUG_ON_FOLIO(!folio_test_large(folio[1]), folio[1]);
> + VM_BUG_ON_FOLIO(folio_nr_pages(folio[0]) != folio_nr_pages(folio[1]), folio[1]);
Looks like I got my assertions backward. We want to BUG if the folios are large,
or if they are different sizes. Disregard v2, its fixed in v3.
next prev parent reply other threads:[~2022-11-18 7:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 2:14 [PATCH v2 0/4] Removing the try_to_release_page() wrapper Vishal Moola (Oracle)
2022-11-18 2:14 ` [PATCH v2 1/4] ext4: Convert move_extent_per_page() to use folios Vishal Moola (Oracle)
2022-11-18 7:28 ` Vishal Moola [this message]
2022-11-18 2:14 ` [PATCH v2 2/4] khugepage: Replace try_to_release_page() with filemap_release_folio() Vishal Moola (Oracle)
2022-11-18 2:14 ` [PATCH v2 3/4] memory-failure: Convert truncate_error_page() to use folio Vishal Moola (Oracle)
2022-11-18 2:14 ` [PATCH v2 4/4] folio-compat: Remove try_to_release_page() Vishal Moola (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOzc2pxYSpQGEEads3qfxyJgdcDzMoEyTg01Z3D2ZaAjUSOznw@mail.gmail.com \
--to=vishal.moola@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.com \
--cc=tytso@mit.edu \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox