* [PATCH v3 2/6] btrfs: drop usage of folio_index
[not found] <20250430181052.55698-1-ryncsn@gmail.com>
@ 2025-04-30 18:10 ` Kairui Song
2025-04-30 21:06 ` Andrew Morton
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Kairui Song @ 2025-04-30 18:10 UTC (permalink / raw)
To: linux-mm
Cc: Andrew Morton, Matthew Wilcox, Hugh Dickins, Chris Li,
David Hildenbrand, Yosry Ahmed, Huang, Ying, Nhat Pham,
Johannes Weiner, linux-kernel, Kairui Song, Chris Mason,
Josef Bacik, David Sterba, linux-btrfs, Qu Wenruo
From: Kairui Song <kasong@tencent.com>
folio_index is only needed for mixed usage of page cache and swap
cache, for pure page cache usage, the caller can just use
folio->index instead.
It can't be a swap cache folio here. Swap mapping may only call into fs
through `swap_rw` but btrfs does not use that method for swap.
Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
Cc: linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM)
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/extent_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 197f5e51c474..e08b50504d13 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3509,7 +3509,7 @@ static void btree_clear_folio_dirty_tag(struct folio *folio)
xa_lock_irq(&folio->mapping->i_pages);
if (!folio_test_dirty(folio))
__xa_clear_mark(&folio->mapping->i_pages,
- folio_index(folio), PAGECACHE_TAG_DIRTY);
+ folio->index, PAGECACHE_TAG_DIRTY);
xa_unlock_irq(&folio->mapping->i_pages);
}
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 18:10 ` [PATCH v3 2/6] btrfs: drop usage of folio_index Kairui Song
@ 2025-04-30 21:06 ` Andrew Morton
2025-04-30 21:07 ` David Hildenbrand
2025-04-30 21:08 ` David Hildenbrand
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2025-04-30 21:06 UTC (permalink / raw)
To: Kairui Song
Cc: Kairui Song, linux-mm, Matthew Wilcox, Hugh Dickins, Chris Li,
David Hildenbrand, Yosry Ahmed, Huang, Ying, Nhat Pham,
Johannes Weiner, linux-kernel, Chris Mason, Josef Bacik,
David Sterba, linux-btrfs, Qu Wenruo
On Thu, 1 May 2025 02:10:48 +0800 Kairui Song <ryncsn@gmail.com> wrote:
> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
Please tell us where these extra tags came from. Did some tool
generate them?
I think they're quite useful - perhaps something we could encourage.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 21:06 ` Andrew Morton
@ 2025-04-30 21:07 ` David Hildenbrand
2025-05-01 10:13 ` Kairui Song
0 siblings, 1 reply; 7+ messages in thread
From: David Hildenbrand @ 2025-04-30 21:07 UTC (permalink / raw)
To: Andrew Morton, Kairui Song
Cc: Kairui Song, linux-mm, Matthew Wilcox, Hugh Dickins, Chris Li,
Yosry Ahmed, Huang, Ying, Nhat Pham, Johannes Weiner,
linux-kernel, Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
Qu Wenruo
On 30.04.25 23:06, Andrew Morton wrote:
> On Thu, 1 May 2025 02:10:48 +0800 Kairui Song <ryncsn@gmail.com> wrote:
>
>> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
>> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
>> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
>
> Please tell us where these extra tags came from. Did some tool
> generate them?
>
> I think they're quite useful - perhaps something we could encourage.
>
I guess that's just the get_maintainers output?
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 18:10 ` [PATCH v3 2/6] btrfs: drop usage of folio_index Kairui Song
2025-04-30 21:06 ` Andrew Morton
@ 2025-04-30 21:08 ` David Hildenbrand
2025-05-01 8:50 ` David Sterba
2025-05-02 11:10 ` David Sterba
3 siblings, 0 replies; 7+ messages in thread
From: David Hildenbrand @ 2025-04-30 21:08 UTC (permalink / raw)
To: Kairui Song, linux-mm
Cc: Andrew Morton, Matthew Wilcox, Hugh Dickins, Chris Li,
Yosry Ahmed, Huang, Ying, Nhat Pham, Johannes Weiner,
linux-kernel, Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
Qu Wenruo
On 30.04.25 20:10, Kairui Song wrote:
> From: Kairui Song <kasong@tencent.com>
>
> folio_index is only needed for mixed usage of page cache and swap
> cache, for pure page cache usage, the caller can just use
> folio->index instead.
>
> It can't be a swap cache folio here. Swap mapping may only call into fs
> through `swap_rw` but btrfs does not use that method for swap.
>
> Signed-off-by: Kairui Song <kasong@tencent.com>
> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM)
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> ---
> fs/btrfs/extent_io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 197f5e51c474..e08b50504d13 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3509,7 +3509,7 @@ static void btree_clear_folio_dirty_tag(struct folio *folio)
> xa_lock_irq(&folio->mapping->i_pages);
> if (!folio_test_dirty(folio))
> __xa_clear_mark(&folio->mapping->i_pages,
> - folio_index(folio), PAGECACHE_TAG_DIRTY);
> + folio->index, PAGECACHE_TAG_DIRTY);
> xa_unlock_irq(&folio->mapping->i_pages);
> }
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 18:10 ` [PATCH v3 2/6] btrfs: drop usage of folio_index Kairui Song
2025-04-30 21:06 ` Andrew Morton
2025-04-30 21:08 ` David Hildenbrand
@ 2025-05-01 8:50 ` David Sterba
2025-05-02 11:10 ` David Sterba
3 siblings, 0 replies; 7+ messages in thread
From: David Sterba @ 2025-05-01 8:50 UTC (permalink / raw)
To: Kairui Song
Cc: linux-mm, Andrew Morton, Matthew Wilcox, Hugh Dickins, Chris Li,
David Hildenbrand, Yosry Ahmed, Huang, Ying, Nhat Pham,
Johannes Weiner, linux-kernel, Chris Mason, Josef Bacik,
David Sterba, linux-btrfs, Qu Wenruo
On Thu, May 01, 2025 at 02:10:48AM +0800, Kairui Song wrote:
> From: Kairui Song <kasong@tencent.com>
>
> folio_index is only needed for mixed usage of page cache and swap
> cache, for pure page cache usage, the caller can just use
> folio->index instead.
>
> It can't be a swap cache folio here. Swap mapping may only call into fs
> through `swap_rw` but btrfs does not use that method for swap.
>
> Signed-off-by: Kairui Song <kasong@tencent.com>
> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM)
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
The patch is from a series but seems to be independent. I'd like to take
it through the btrfs tree unless you have other work that depends on it.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 21:07 ` David Hildenbrand
@ 2025-05-01 10:13 ` Kairui Song
0 siblings, 0 replies; 7+ messages in thread
From: Kairui Song @ 2025-05-01 10:13 UTC (permalink / raw)
To: David Hildenbrand
Cc: Andrew Morton, linux-mm, Matthew Wilcox, Hugh Dickins, Chris Li,
Yosry Ahmed, Huang, Ying, Nhat Pham, Johannes Weiner,
linux-kernel, Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
Qu Wenruo
On Thu, May 1, 2025 at 5:07 AM David Hildenbrand <david@redhat.com> wrote:
>
> On 30.04.25 23:06, Andrew Morton wrote:
> > On Thu, 1 May 2025 02:10:48 +0800 Kairui Song <ryncsn@gmail.com> wrote:
> >
> >> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> >> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
> >> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
> >
> > Please tell us where these extra tags came from. Did some tool
> > generate them?
> >
> > I think they're quite useful - perhaps something we could encourage.
> >
>
> I guess that's just the get_maintainers output?
Yes, `./scripts/get_maintainer.pl fs/btrfs/` generated these,
`./scripts/checkpatch.pl` didn't complain so I forgot to truncate
them. Glad to know it's considered helpful :)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/6] btrfs: drop usage of folio_index
2025-04-30 18:10 ` [PATCH v3 2/6] btrfs: drop usage of folio_index Kairui Song
` (2 preceding siblings ...)
2025-05-01 8:50 ` David Sterba
@ 2025-05-02 11:10 ` David Sterba
3 siblings, 0 replies; 7+ messages in thread
From: David Sterba @ 2025-05-02 11:10 UTC (permalink / raw)
To: Kairui Song
Cc: linux-mm, Andrew Morton, Matthew Wilcox, Hugh Dickins, Chris Li,
David Hildenbrand, Yosry Ahmed, Huang, Ying, Nhat Pham,
Johannes Weiner, linux-kernel, Chris Mason, Josef Bacik,
David Sterba, linux-btrfs, Qu Wenruo
On Thu, May 01, 2025 at 02:10:48AM +0800, Kairui Song wrote:
> From: Kairui Song <kasong@tencent.com>
>
> folio_index is only needed for mixed usage of page cache and swap
> cache, for pure page cache usage, the caller can just use
> folio->index instead.
>
> It can't be a swap cache folio here. Swap mapping may only call into fs
> through `swap_rw` but btrfs does not use that method for swap.
>
> Signed-off-by: Kairui Song <kasong@tencent.com>
> Cc: Chris Mason <clm@fb.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <josef@toxicpanda.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: David Sterba <dsterba@suse.com> (maintainer:BTRFS FILE SYSTEM)
> Cc: linux-btrfs@vger.kernel.org (open list:BTRFS FILE SYSTEM)
> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Reviewed-by: Qu Wenruo <wqu@suse.com>
I've added the patch to our for-next, so Andrew can drop it from his
patch queue.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-02 11:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250430181052.55698-1-ryncsn@gmail.com>
2025-04-30 18:10 ` [PATCH v3 2/6] btrfs: drop usage of folio_index Kairui Song
2025-04-30 21:06 ` Andrew Morton
2025-04-30 21:07 ` David Hildenbrand
2025-05-01 10:13 ` Kairui Song
2025-04-30 21:08 ` David Hildenbrand
2025-05-01 8:50 ` David Sterba
2025-05-02 11:10 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox