Skip to content

Commit b678912

Browse files
Hugh Dickinstorvalds
authored andcommitted
mm: fix KPF_SWAPCACHE in /proc/kpageflags
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]>
1 parent a524c21 commit b678912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/proc/page.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ u64 stable_page_flags(struct page *page)
173173
u |= kpf_copy_bit(k, KPF_ACTIVE, PG_active);
174174
u |= kpf_copy_bit(k, KPF_RECLAIM, PG_reclaim);
175175

176-
u |= kpf_copy_bit(k, KPF_SWAPCACHE, PG_swapcache);
176+
if (PageSwapCache(page))
177+
u |= 1 << KPF_SWAPCACHE;
177178
u |= kpf_copy_bit(k, KPF_SWAPBACKED, PG_swapbacked);
178179

179180
u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable);

0 commit comments

Comments
 (0)