From: Mike Kravetz <mike.kravetz@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>,
Ackerley Tng <ackerleytng@google.com>,
Sidhartha Kumar <sidhartha.kumar@oracle.com>,
Muchun Song <songmuchun@bytedance.com>,
vannapurve@google.com, erdemaktas@google.com,
stable <stable@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 0/1] RESEND fix page_cache_next/prev_miss off by one error
Date: Fri, 2 Jun 2023 19:22:09 -0700 [thread overview]
Message-ID: <20230603022209.GA114055@monkey> (raw)
In-Reply-To: <20230602175547.dba09bb3ef7eb0bc508b3a5a@linux-foundation.org>
On 06/02/23 17:55, Andrew Morton wrote:
> On Fri, 2 Jun 2023 15:57:46 -0700 Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> > In commits d0ce0e47b323 and 91a2fb956ad99, hugetlb code was changed to
> > use page_cache_next_miss to determine if a page was present in the page
> > cache. However, the current implementation of page_cache_next_miss will
> > always return the passed index if max_scan is 1 as in the hugetlb code.
> > As a result, hugetlb code will always thing a page is present in the
> > cache, even if that is not the case.
> >
> > The patch which follows addresses the issue by changing the implementation
> > of page_cache_next_miss and for consistency page_cache_prev_miss. Since
> > such a patch also impacts the readahead code, I would suggest using the
> > patch by Sidhartha Kumar [1] to fix the issue in 6.3 and this patch moving
> > forward.
>
> Well this is tricky.
>
> This patch applies cleanly to 6.3, so if we add cc:stable to this
> patch, it will get backported, against your suggestion.
>
> Sidhartha's patch [1] (which you recommend for -stable) is quite
> different from this patch. And Sidhartha's patch has no route to being
> tested in linux-next nor to being merged by Linus.
>
> So problems. The preferable approach is to just backport this patch
> into -stable in the usual fashion. What are the risks in doing this?
Really hoping to get some comments from Matthew on this.
The only other user is the readahead code and I have little
experience/knowledge there.
Unless I totally screwed up the code, page_cache_next/prev_miss will now
correctly indicate the lack of a page in the cache in these edge cases.
Since readahead is more about performance than correctness (not trying
to minimize), the risk should be small.
--
Mike Kravetz
>
prev parent reply other threads:[~2023-06-03 2:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 22:57 [PATCH 0/1] RESEND fix page_cache_next/prev_miss off by one error Mike Kravetz
2023-06-02 22:57 ` [PATCH 1/1] page cache: fix page_cache_next/prev_miss off by one Mike Kravetz
2023-06-03 0:59 ` Andrew Morton
2023-06-03 2:24 ` Mike Kravetz
2023-06-05 17:26 ` Ackerley Tng
2023-06-06 22:41 ` Mike Kravetz
2023-06-06 23:35 ` Ackerley Tng
2023-06-03 0:55 ` [PATCH 0/1] RESEND fix page_cache_next/prev_miss off by one error Andrew Morton
2023-06-03 2:22 ` Mike Kravetz [this message]
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=20230603022209.GA114055@monkey \
--to=mike.kravetz@oracle.com \
--cc=ackerleytng@google.com \
--cc=akpm@linux-foundation.org \
--cc=erdemaktas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sidhartha.kumar@oracle.com \
--cc=songmuchun@bytedance.com \
--cc=stable@vger.kernel.org \
--cc=vannapurve@google.com \
--cc=willy@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).