All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove btrfs_set_range_writeback()
Date: Tue, 8 Oct 2024 23:39:20 +0200	[thread overview]
Message-ID: <20241008213920.GI1609@suse.cz> (raw)
In-Reply-To: <9de4892b-f1dc-4dc1-a63b-71564aaf1a94@gmx.com>

On Wed, Oct 09, 2024 at 07:26:36AM +1030, Qu Wenruo wrote:
> >> --- a/fs/btrfs/inode.c
> >> +++ b/fs/btrfs/inode.c
> >> @@ -8939,28 +8939,6 @@ static int btrfs_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
> >>   	return finish_open_simple(file, ret);
> >>   }
> >>
> >> -void btrfs_set_range_writeback(struct btrfs_inode *inode, u64 start, u64 end)
> >> -{
> >> -	struct btrfs_fs_info *fs_info = inode->root->fs_info;
> >> -	unsigned long index = start >> PAGE_SHIFT;
> >> -	unsigned long end_index = end >> PAGE_SHIFT;
> >> -	struct folio *folio;
> >> -	u32 len;
> >> -
> >> -	ASSERT(end + 1 - start <= U32_MAX);
> >> -	len = end + 1 - start;
> >> -	while (index <= end_index) {
> >> -		folio = __filemap_get_folio(inode->vfs_inode.i_mapping, index, 0, 0);
> >> -		ASSERT(!IS_ERR(folio)); /* folios should be in the extent_io_tree */
> >> -
> >> -		/* This is for data, which doesn't yet support larger folio. */
> >> -		ASSERT(folio_order(folio) == 0);
> >> -		btrfs_folio_set_writeback(fs_info, folio, start, len);
> >
> > So the new code is just btrfs_folio_set_writeback(), with the removed
> > comment and assertion,
> 
> Firstly, the length check is already inside btrfs_folio_set_writeback()
> for the subpage cases.
> If it's not subpage, we do not even need to check the range (it's always
> page aligned).
> 
> Secondly for the folio, we do not need the ASSERT(), because this time
> we have the folio pointer already.
> 
> So for the assert part, there is no change.

Ok.

> > what's the status regarding large folios?
> 
> That stays the same, no larger folio support.
> 
> The larger folio support requires us to get rid of the per-fs
> sectors_per_page check, but using folio_size() to do the calculation.
> 
> That will still be a lot of work to do before we can support larger
> folios for data.

My question was about this specific place in the code, if we e.g. remove
various assertions making sure we don't accidentally get there with
large folios after they get enabled in the future. It's ok when other
code makes different checks that would prevent it, but that's what I did
not immediately see. Thanks.

  reply	other threads:[~2024-10-08 21:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-06  0:40 [PATCH] btrfs: remove btrfs_set_range_writeback() Qu Wenruo
2024-10-08 16:43 ` David Sterba
2024-10-08 20:56   ` Qu Wenruo
2024-10-08 21:39     ` David Sterba [this message]
2024-10-08 21:55       ` Qu Wenruo
2024-10-10 17:18 ` David Sterba

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=20241008213920.GI1609@suse.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.