From: Matthew Wilcox <willy@infradead.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Muchun Song <songmuchun@bytedance.com>,
akpm@linux-foundation.org, william.kucharski@oracle.com,
kirill.shutemov@linux.intel.com, dhowells@redhat.com,
hannes@cmpxchg.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: Re: [PATCH] mm: remove redundant compound_head() calling
Date: Fri, 13 Aug 2021 15:24:43 +0100 [thread overview]
Message-ID: <YRaAq1RUjleXFPid@casper.infradead.org> (raw)
In-Reply-To: <808194f6-e5d0-59e4-ffd5-2c77a907232c@suse.cz>
On Fri, Aug 13, 2021 at 04:02:33PM +0200, Vlastimil Babka wrote:
> On 8/11/21 12:14 PM, Muchun Song wrote:
> > There is a READ_ONCE() in the macro of compound_head(), which will
> > prevent compiler from optimizing the code when there are more than
> > once calling of it in a function. Remove the redundant calling of
> > compound_head() from page_to_index() and page_add_file_rmap() for
> > better code generation.
> >
> > Signed-off-by: Muchun Song <songmuchun@bytedance.com>
>
> Seems to be compatible with folio/for-next and not made redundant by that (yet?
> didn't check the branches planned for future versions), so OK. But long-term I'd
> expect these optimizations to be obsoleted by the folio work.
Yes, I haven't touched page_add_file_rmap() in my tree yet. Trying to
keep my focus on page cache instead of working on more generic mm stuff.
Hopefully other people will work on those pieces once the folio work
lands.
Looking at page_add_file_rmap(), it needs someone to think in detail
about what 'compound' means in the context of sub-PMD-sized compound
pages. I suspect it really means "map_as_pmd".
prev parent reply other threads:[~2021-08-13 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-11 10:14 Muchun Song
2021-08-13 14:02 ` Vlastimil Babka
2021-08-13 14:24 ` Matthew Wilcox [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=YRaAq1RUjleXFPid@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=songmuchun@bytedance.com \
--cc=vbabka@suse.cz \
--cc=william.kucharski@oracle.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