Skip to content

Commit

Permalink
mm: fix KPF_SWAPCACHE in /proc/kpageflags
Browse files Browse the repository at this point in the history
Commit 6326fec ("mm: Use owner_priv bit for PageSwapCache, valid
when PageSwapBacked") aliased PG_swapcache to PG_owner_priv_1 (and
depending on PageSwapBacked being true).

As a result, the KPF_SWAPCACHE bit in '/proc/kpageflags' should now be
synthesized, instead of being shown on unrelated pages which just happen
to have PG_owner_priv_1 set.

Signed-off-by: Hugh Dickins <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Wu Fengguang <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and torvalds committed Feb 7, 2017
1 parent a524c21 commit b678912
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/proc/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ u64 stable_page_flags(struct page *page)
u |= kpf_copy_bit(k, KPF_ACTIVE, PG_active);
u |= kpf_copy_bit(k, KPF_RECLAIM, PG_reclaim);

u |= kpf_copy_bit(k, KPF_SWAPCACHE, PG_swapcache);
if (PageSwapCache(page))
u |= 1 << KPF_SWAPCACHE;
u |= kpf_copy_bit(k, KPF_SWAPBACKED, PG_swapbacked);

u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable);
Expand Down

0 comments on commit b678912

Please sign in to comment.