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>,
Vishal Annapurve <vannapurve@google.com>,
Erdem Aktas <erdemaktas@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH 1/2] Revert "page cache: fix page_cache_next/prev_miss off by one"
Date: Wed, 21 Jun 2023 16:01:47 -0700 [thread overview]
Message-ID: <20230621230147.GC4155@monkey> (raw)
In-Reply-To: <20230621151855.318449527a851cc0bb62fb34@linux-foundation.org>
On 06/21/23 15:18, Andrew Morton wrote:
> On Wed, 21 Jun 2023 14:24:02 -0700 Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> > This reverts commit 9425c591e06a9ab27a145ba655fb50532cf0bcc9
> >
> > The reverted commit fixed up routines primarily used by readahead code
> > such that they could also be used by hugetlb. Unfortunately, this
> > caused a performance regression as pointed out by the Closes: tag.
> >
> > The hugetlb code which uses page_cache_next_miss will be addressed in
> > a subsequent patch.
>
> Often these throughput changes are caused by rather random
> alignment/layout changes and the code change itself was innocent.
>
> Do we have an explanation for this regression, or was it a surprise?
It was not a total surprise. As mentioned, the primary user of this
interface is the readahead code. The code in question is in
ondemand_readahead.
rcu_read_lock();
start = page_cache_next_miss(ractl->mapping, index + 1,
max_pages);
rcu_read_unlock();
if (!start || start - index > max_pages)
return;
With the reverted changes, we will take that quick return when there are
no gaps in the range. Previously we did not.
I am of the belief that page_cache_next_miss behavior did not match the
function description. Matthew suggested page_cache_next_miss use in hugetlb
code and I can only guess that he also though it behaved as documented.
I do not know the readahead code well enough to know exactly what is
expected. readahead certainly performs worse with my proposed changes.
Since we can easily 'fix' hugetlb code in another way, let's do that and
leave the readahead code alone unless someone more knowledgable can
provide insight.
--
Mike Kravetz
next prev parent reply other threads:[~2023-06-21 23:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 21:24 [PATCH 1/2] Revert "page cache: fix page_cache_next/prev_miss off by one" Mike Kravetz
2023-06-21 21:24 ` [PATCH 2/2] hugetlb: revert use of page_cache_next_miss() Mike Kravetz
2023-06-21 22:19 ` Sidhartha Kumar
2023-06-21 22:39 ` Andrew Morton
2023-06-21 22:46 ` Mike Kravetz
2023-06-21 22:52 ` Andrew Morton
2023-06-21 23:02 ` Mike Kravetz
2023-06-21 22:15 ` [PATCH 1/2] Revert "page cache: fix page_cache_next/prev_miss off by one" Sidhartha Kumar
2023-06-21 22:18 ` Andrew Morton
2023-06-21 23:01 ` Mike Kravetz [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-07-24 12:15 Thomas Backlund
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=20230621230147.GC4155@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=oliver.sang@intel.com \
--cc=sidhartha.kumar@oracle.com \
--cc=songmuchun@bytedance.com \
--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).