Linux EXT4 FS development
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Jan Kara <jack@suse.cz>, Ted Tso <tytso@mit.edu>,
	linux-ext4@vger.kernel.org, Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 5/9] ext4: Add support for writepages calls that cannot map blocks
Date: Thu, 1 Dec 2022 12:50:19 +0100	[thread overview]
Message-ID: <20221201115019.jot525ry25gk4ggh@quack3> (raw)
In-Reply-To: <20221201111359.onr5edsaaxcr2ndh@riteshh-domain>

On Thu 01-12-22 16:43:59, Ritesh Harjani (IBM) wrote:
> On 22/11/30 05:35PM, Jan Kara wrote:
> > Add support for calls to ext4_writepages() than cannot map blocks. These
> > will be issued from jbd2 transaction commit code.
> 
> I guess we should expand the description of mpage_prepare_extent_to_map()
> function now. Other than that the patch looks good to me.
> 
> Please feel free to add:
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

Thanks for review!

> >  /*
> >   * mpage_prepare_extent_to_map - find & lock contiguous range of dirty pages
> >   * 				 and underlying extent to map
> 
> Since we are overloading this function. this can be also called with can_map
> as 0. Maybe good to add some description around that?

Well, it was somewhat overloaded already before but you're right some
documentation update is in order :) I'll do that.

> > @@ -2651,14 +2665,30 @@ static int mpage_prepare_extent_to_map(struct mpage_da_data *mpd)
> 
> 
> adding context of code so that it doesn't get missed in the discussion.
> 
> <...>
> 			/* If we can't merge this page, we are done. */
> 			if (mpd->map.m_len > 0 && mpd->next_page != page->index)
> 				goto out;
> 
> I guess this also will not hold for us given we will always have m_len to be 0.
> <...>

Correct.

> > +			/*
> > +			 * Writeout for transaction commit where we cannot
> > +			 * modify metadata is simple. Just submit the page.
> > +			 */
> > +			if (!mpd->can_map) {
> > +				if (ext4_page_nomap_can_writeout(page)) {
> > +					err = mpage_submit_page(mpd, page);
> > +					if (err < 0)
> > +						goto out;
> > +				} else {
> > +					unlock_page(page);
> > +					mpd->first_page++;
> 
> We anyway should always have mpd->map.m_len = 0.
> That means, we always set mpd->first_page = page->index above.
> So this might not be useful. But I guess for consistency of the code,
> or to avoid any future bugs, this isn't harmful to keep.

Yes, it is mostly for consistency but it is also needed so that once we
exit the loop, mpage_release_unused_pages() starts working from a correct
page.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2022-12-01 11:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 16:35 [PATCH 0/9] ext4: Stop using ext4_writepage() for writeout of ordered data Jan Kara
2022-11-30 16:35 ` [PATCH 1/9] ext4: Handle redirtying in ext4_bio_write_page() Jan Kara
2022-12-01  8:57   ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 2/9] ext4: Move keep_towrite handling to ext4_bio_write_page() Jan Kara
2022-12-01  9:13   ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 3/9] ext4: Remove nr_submitted from ext4_bio_write_page() Jan Kara
2022-12-01  9:14   ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 4/9] ext4: Drop pointless IO submission " Jan Kara
2022-12-01  7:06   ` Ritesh Harjani (IBM)
2022-12-01 10:35     ` Jan Kara
2022-12-01 13:40       ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 5/9] ext4: Add support for writepages calls that cannot map blocks Jan Kara
2022-12-01 11:13   ` Ritesh Harjani (IBM)
2022-12-01 11:50     ` Jan Kara [this message]
2022-12-01 13:28       ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 6/9] ext4: Provide ext4_do_writepages() Jan Kara
2022-12-01 11:15   ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 7/9] ext4: Move percpu_rwsem protection into ext4_writepages() Jan Kara
2022-12-01 11:16   ` Ritesh Harjani (IBM)
2022-11-30 16:35 ` [PATCH 8/9] ext4: Switch to using ext4_do_writepages() for ordered data writeout Jan Kara
2022-12-01 11:17   ` Ritesh Harjani (IBM)
2022-11-30 16:36 ` [PATCH 9/9] ext4: Remove ordered data support from ext4_writepage() Jan Kara
2022-12-01 11:21   ` Ritesh Harjani (IBM)
2022-12-01 13:36     ` Ritesh Harjani (IBM)
2022-12-01 14:11       ` Jan Kara
2022-12-01 14:25         ` Christoph Hellwig
2022-12-01 11:42 ` [PATCH 0/9] ext4: Stop using ext4_writepage() for writeout of ordered data Ritesh Harjani (IBM)
2022-12-01 11:55   ` Jan Kara

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=20221201115019.jot525ry25gk4ggh@quack3 \
    --to=jack@suse.cz \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --cc=tytso@mit.edu \
    /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