[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMgjq7BT38kCb_c=OLmt3EOSi-wFgGG7KLuSJLkm1Er9HF4wfg@mail.gmail.com>
Date: Tue, 29 Apr 2025 16:54:11 +0800
From: Kairui Song <ryncsn@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>, Hugh Dickins <hughd@...gle.com>, Chris Li <chrisl@...nel.org>,
Yosry Ahmed <yosryahmed@...gle.com>, "Huang, Ying" <ying.huang@...ux.alibaba.com>,
Nhat Pham <nphamcs@...il.com>, Johannes Weiner <hannes@...xchg.org>, linux-kernel@...r.kernel.org,
Miklos Szeredi <miklos@...redi.hu>, Joanne Koong <joannelkoong@...il.com>,
Josef Bacik <josef@...icpanda.com>, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH 1/6] fuse: drop usage of folio_index
On Mon, Apr 28, 2025 at 8:38 AM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Mon, Apr 28, 2025 at 02:59:03AM +0800, Kairui Song wrote:
> > 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` and that is not supported for fuse. So just drop it
> > and use folio->index instead.
> >
> > uigned-off-by: Kairui Song <kasong@...cent.com>
> > Cc: Miklos Szeredi <miklos@...redi.hu>
> > Cc: Joanne Koong <joannelkoong@...il.com>
> > Cc: Josef Bacik <josef@...icpanda.com>
> > Cc: linux-fsdevel@...r.kernel.org
> > Signed-off-by: Kairui Song <kasong@...cent.com>
>
> Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Thanks for the review.
>
> > @@ -2349,7 +2349,7 @@ static bool fuse_writepage_need_send(struct fuse_conn *fc, struct folio *folio,
> > return true;
> >
> > /* Discontinuity */
> > - if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio_index(folio))
> > + if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio->index)
> > return true;
>
> This looks like a pre-existing bug.
>
> - if (data->orig_folios[ap->num_folios - 1]->index + 1 != folio_index(folio))
> + prev_folio = data->orig_folios[ap->num_folios - 1];
> + if (prev_folio->index + folio_nr_pages(prev_folio) != folio->index)
> return true;
>
It seems FUSE does not work with high order folios yet, a lot of
allocation and operation here are assuming folio size == PAGE_SIZE. I
think I'll just leave it here.
Powered by blists - more mailing lists