]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: remove redundant compound_head() calling
authorMuchun Song <songmuchun@bytedance.com>
Mon, 23 Aug 2021 23:59:43 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:34:26 +0000 (09:34 +1000)
commitaa6da1c42ef3d108f5aa80237f032cd11a27ea5b
tree016588183ada8eee67826bbfc0dc5dc4a2bbbca2
parent4d6b69278e0457f16ac7de549b28409ccf6ed048
mm: remove redundant compound_head() calling

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.

Link: https://lkml.kernel.org/r/20210811101431.83940-1-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: William Kucharski <william.kucharski@oracle.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
include/linux/pagemap.h
mm/rmap.c