Skip to content

Commit 8cb38fa

Browse files
kiryltorvalds
authored andcommitted
page-flags: define behavior of LRU-related flags on compound pages
Only head pages are ever on LRU. Let's use PF_HEAD policy to avoid any confusion for all LRU-related flags. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Christoph Lameter <cl@linux.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Steve Capper <steve.capper@linaro.org> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: Jérôme Glisse <jglisse@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent df8c94d commit 8cb38fa

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

include/linux/page-flags.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,14 @@ static inline int __TestClearPage##uname(struct page *page) { return 0; }
258258

259259
__PAGEFLAG(Locked, locked, PF_NO_TAIL)
260260
PAGEFLAG(Error, error, PF_NO_COMPOUND) TESTCLEARFLAG(Error, error, PF_NO_COMPOUND)
261-
PAGEFLAG(Referenced, referenced, PF_ANY) TESTCLEARFLAG(Referenced, referenced, PF_ANY)
262-
__SETPAGEFLAG(Referenced, referenced, PF_ANY)
261+
PAGEFLAG(Referenced, referenced, PF_HEAD)
262+
TESTCLEARFLAG(Referenced, referenced, PF_HEAD)
263+
__SETPAGEFLAG(Referenced, referenced, PF_HEAD)
263264
PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
264265
__CLEARPAGEFLAG(Dirty, dirty, PF_HEAD)
265-
PAGEFLAG(LRU, lru, PF_ANY) __CLEARPAGEFLAG(LRU, lru, PF_ANY)
266-
PAGEFLAG(Active, active, PF_ANY) __CLEARPAGEFLAG(Active, active, PF_ANY)
267-
TESTCLEARFLAG(Active, active, PF_ANY)
266+
PAGEFLAG(LRU, lru, PF_HEAD) __CLEARPAGEFLAG(LRU, lru, PF_HEAD)
267+
PAGEFLAG(Active, active, PF_HEAD) __CLEARPAGEFLAG(Active, active, PF_HEAD)
268+
TESTCLEARFLAG(Active, active, PF_HEAD)
268269
__PAGEFLAG(Slab, slab, PF_ANY)
269270
PAGEFLAG(Checked, checked, PF_NO_COMPOUND) /* Used by some filesystems */
270271
PAGEFLAG(Pinned, pinned, PF_ANY) TESTSCFLAG(Pinned, pinned, PF_ANY) /* Xen */
@@ -318,9 +319,9 @@ PAGEFLAG(SwapCache, swapcache, PF_ANY)
318319
PAGEFLAG_FALSE(SwapCache)
319320
#endif
320321

321-
PAGEFLAG(Unevictable, unevictable, PF_ANY)
322-
__CLEARPAGEFLAG(Unevictable, unevictable, PF_ANY)
323-
TESTCLEARFLAG(Unevictable, unevictable, PF_ANY)
322+
PAGEFLAG(Unevictable, unevictable, PF_HEAD)
323+
__CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD)
324+
TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD)
324325

325326
#ifdef CONFIG_MMU
326327
PAGEFLAG(Mlocked, mlocked, PF_ANY) __CLEARPAGEFLAG(Mlocked, mlocked, PF_ANY)

0 commit comments

Comments
 (0)