* [PATCH] mm: fix KPF_SWAPCACHE
@ 2017-02-07 19:11 Hugh Dickins
2017-02-09 4:20 ` Nicholas Piggin
0 siblings, 1 reply; 3+ messages in thread
From: Hugh Dickins @ 2017-02-07 19:11 UTC (permalink / raw)
To: Linus Torvalds
Cc: Andrew Morton, Nicholas Piggin, Wu Fengguang, linux-kernel, linux-mm
4.10-rc1 commit 6326fec1122c ("mm: Use owner_priv bit for PageSwapCache,
valid when PageSwapBacked") aliased PG_swapcache to PG_owner_priv_1:
so /proc/kpageflags' KPF_SWAPCACHE should now be synthesized, instead
of being shown on unrelated pages which have PG_owner_priv_1 set.
Signed-off-by: Hugh Dickins <hughd@google.com>
---
fs/proc/page.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 4.10-rc7/fs/proc/page.c 2016-12-25 18:40:50.618454962 -0800
+++ linux/fs/proc/page.c 2017-02-07 10:28:51.019640392 -0800
@@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: fix KPF_SWAPCACHE
2017-02-07 19:11 [PATCH] mm: fix KPF_SWAPCACHE Hugh Dickins
@ 2017-02-09 4:20 ` Nicholas Piggin
2017-02-09 4:50 ` Hugh Dickins
0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Piggin @ 2017-02-09 4:20 UTC (permalink / raw)
To: Hugh Dickins
Cc: Linus Torvalds, Andrew Morton, Wu Fengguang, linux-kernel, linux-mm
On Tue, 7 Feb 2017 11:11:16 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:
> 4.10-rc1 commit 6326fec1122c ("mm: Use owner_priv bit for PageSwapCache,
> valid when PageSwapBacked") aliased PG_swapcache to PG_owner_priv_1:
> so /proc/kpageflags' KPF_SWAPCACHE should now be synthesized, instead
> of being shown on unrelated pages which have PG_owner_priv_1 set.
>
> Signed-off-by: Hugh Dickins <hughd@google.com>
Thanks Hugh, this seems fine to me. We want this for 4.10, no?
Fixes: 6326fec1122c ("mm: Use owner_priv bit for PageSwapCache, valid when PageSwapBacked")
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
> ---
>
> fs/proc/page.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- 4.10-rc7/fs/proc/page.c 2016-12-25 18:40:50.618454962 -0800
> +++ linux/fs/proc/page.c 2017-02-07 10:28:51.019640392 -0800
> @@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: fix KPF_SWAPCACHE
2017-02-09 4:20 ` Nicholas Piggin
@ 2017-02-09 4:50 ` Hugh Dickins
0 siblings, 0 replies; 3+ messages in thread
From: Hugh Dickins @ 2017-02-09 4:50 UTC (permalink / raw)
To: Nicholas Piggin
Cc: Hugh Dickins, Linus Torvalds, Andrew Morton, Wu Fengguang,
linux-kernel, linux-mm
On Thu, 9 Feb 2017, Nicholas Piggin wrote:
> On Tue, 7 Feb 2017 11:11:16 -0800 (PST)
> Hugh Dickins <hughd@google.com> wrote:
>
> > 4.10-rc1 commit 6326fec1122c ("mm: Use owner_priv bit for PageSwapCache,
> > valid when PageSwapBacked") aliased PG_swapcache to PG_owner_priv_1:
> > so /proc/kpageflags' KPF_SWAPCACHE should now be synthesized, instead
> > of being shown on unrelated pages which have PG_owner_priv_1 set.
> >
> > Signed-off-by: Hugh Dickins <hughd@google.com>
>
> Thanks Hugh, this seems fine to me. We want this for 4.10, no?
>
> Fixes: 6326fec1122c ("mm: Use owner_priv bit for PageSwapCache, valid when PageSwapBacked")
> Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Thanks Nick, yes, but don't worry: Linus jumped to it, and it's already
in 4.10 as b6789123bccb ("mm: fix KPF_SWAPCACHE in /proc/kpageflags").
Hugh
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-09 5:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 19:11 [PATCH] mm: fix KPF_SWAPCACHE Hugh Dickins
2017-02-09 4:20 ` Nicholas Piggin
2017-02-09 4:50 ` Hugh Dickins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).