linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	songmuchun@bytedance.com, mike.kravetz@oracle.com
Subject: Re: [PATCH v6] mm/filemap: remove hugetlb special casing in filemap.c
Date: Fri, 18 Aug 2023 19:09:33 +0100	[thread overview]
Message-ID: <ZN+z3Q3hAn/GG+d3@casper.infradead.org> (raw)
In-Reply-To: <20230818110309.e9debd8b988cb8ca4a1019be@linux-foundation.org>

On Fri, Aug 18, 2023 at 11:03:09AM -0700, Andrew Morton wrote:
> On Thu, 17 Aug 2023 11:18:36 -0700 Sidhartha Kumar <sidhartha.kumar@oracle.com> wrote:
> 
> > Perf was used to check the performance differences after the patch. Overall
> > the performance is similar to mainline with a very small larger overhead that
> > occurs in __filemap_add_folio() and hugetlb_add_to_page_cache(). This is because
> > of the larger overhead that occurs in xa_load() and xa_store() as the
> > xarray is now using more entries to store hugetlb folios in the page cache.
> 
> So... why merge the patch?  To save 40 lines of code?
> 
> I mean, if a patch which added 40 lines yielded a "very small"
> reduction in overhead, we'd probably merge it!
> 
> Or is there some wider reason for this which the changelog omitted?

Sidhartha's benchmarks are for hugetlbfs which is where we're likely
to see performance regressions.  What's not shown are any performance
numbers for !hugetlbfs.  The functions where this patch removes code
are used on _every_ page cache lookup, so given the typical difference
in number of lookups performed against hugetlb vs non-hugetlb files,
even saving 0.1% performance on non-hugetlb files will lead to fewer
instructions executed overall.

There's also a conceptual reduction in complexity.  We no longer need to
think about whether the inode is hugetlb or not before doing the lookup
and scaling the byte offset differently.


  reply	other threads:[~2023-08-18 18:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 18:18 Sidhartha Kumar
2023-08-18 18:03 ` Andrew Morton
2023-08-18 18:09   ` Matthew Wilcox [this message]
2023-08-18 18:34     ` Mike Kravetz
2023-08-18 18:54       ` Sidhartha Kumar
2023-08-18 19:24         ` Andrew Morton
2023-08-21 18:33 ` Mike Kravetz
2023-09-05  4:05   ` Sidhartha Kumar
2023-09-07  0:18     ` Mike Kravetz
2023-08-22 17:15 ` Matthew Wilcox

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=ZN+z3Q3hAn/GG+d3@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mike.kravetz@oracle.com \
    --cc=sidhartha.kumar@oracle.com \
    --cc=songmuchun@bytedance.com \
    /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