lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Jun 2023 16:01:47 -0700
From:   Mike Kravetz <mike.kravetz@...cle.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org,
        Matthew Wilcox <willy@...radead.org>,
        Ackerley Tng <ackerleytng@...gle.com>,
        Sidhartha Kumar <sidhartha.kumar@...cle.com>,
        Muchun Song <songmuchun@...edance.com>,
        Vishal Annapurve <vannapurve@...gle.com>,
        Erdem Aktas <erdemaktas@...gle.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        kernel test robot <oliver.sang@...el.com>
Subject: Re: [PATCH 1/2] Revert "page cache: fix page_cache_next/prev_miss
 off by one"

On 06/21/23 15:18, Andrew Morton wrote:
> On Wed, 21 Jun 2023 14:24:02 -0700 Mike Kravetz <mike.kravetz@...cle.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ