Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

From: Andrew Morton
Date: Thu Nov 05 2015 - 19:32:18 EST

On Tue, 3 Nov 2015 17:26:15 +0200 "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> I've missed two simlar codepath which need some preparation to work well
> with reworked THP refcounting.
> Both page_referenced() and page_idle_clear_pte_refs_one() assume that
> THP can only be mapped with PMD, so there's no reason to look on PTEs
> for PageTransHuge() pages. That's no true anymore: THP can be mapped
> with PTEs too.
> The patch removes PageTransHuge() test from the functions and opencode
> page table check.

x86_64 allnoconfig:

In file included from mm/rmap.c:47:
include/linux/mm.h: In function 'page_referenced':
include/linux/mm.h:448: error: call to '__compiletime_assert_448' declared with attribute error: BUILD_BUG failed
make[1]: *** [mm/rmap.o] Error 1
make: *** [mm/rmap.o] Error 2


#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })

btw, total_mapcount() is far too large to be inlined and
page_mapcount() is getting pretty bad too.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at