From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx> Since we're checking that PageTail isn't true when we're writing to the bits, we don't need to call compound_head() either. This saves us four instructions per invocation of SetPageFoo / ClearPageFoo for those bits with a TailRead policy. --- include/linux/page-flags.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 1960b5e4b9ab..38ed6f4365d2 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h @@ -174,8 +174,10 @@ static __always_inline struct page *PagePolicyTailRead(struct page *page, bool modify) { CheckPageInit(page); - VM_BUG_ON_PGFLAGS(modify && PageTail(page), page); - return compound_head(page); + if (!modify) + return compound_head(page); + VM_BUG_ON_PGFLAGS(PageTail(page), page); + return page; } static __always_inline struct page *PagePolicyNoCompound(struct page *page) -- 2.16.3