2023-09-15 21:06:57

by Matthew Wilcox

[permalink] [raw]
Subject: Re: [RFC 04/23] filemap: set the order of the index in page_cache_delete_batch()

On Fri, Sep 15, 2023 at 08:38:29PM +0200, Pankaj Raghav wrote:
> From: Luis Chamberlain <[email protected]>
>
> Similar to page_cache_delete(), call xas_set_order for non-hugetlb pages
> while deleting an entry from the page cache.

Is this necessary? As I read xas_store(), if you're storing NULL, it
will wipe out all sibling entries. Was this based on "oops, no, it
doesn't" or "here is a gratuitous difference, change it"?


2023-09-19 03:26:06

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [RFC 04/23] filemap: set the order of the index in page_cache_delete_batch()

On Fri, Sep 15, 2023 at 08:43:28PM +0100, Matthew Wilcox wrote:
> On Fri, Sep 15, 2023 at 08:38:29PM +0200, Pankaj Raghav wrote:
> > From: Luis Chamberlain <[email protected]>
> >
> > Similar to page_cache_delete(), call xas_set_order for non-hugetlb pages
> > while deleting an entry from the page cache.
>
> Is this necessary? As I read xas_store(), if you're storing NULL, it
> will wipe out all sibling entries. Was this based on "oops, no, it
> doesn't" or "here is a gratuitous difference, change it"?

Based on code inspection, I saw page_cache_delete() did it. The xarray
docs and xarray selftest was not clear about the advanced API about this
case and the usage of the set order on page_cache_delete() gave me
concerns we needed it here.

We do have some enhancements to xarray self tests to use the advanced
API which we could extend with this particular case before posting, so
to prove disprove if this is really needed.

Why would it be needed on page_cache_delete() but needed here?

Luis