* [PATCH] fix-proc-page
@ 2024-04-03 17:31 Matthew Wilcox (Oracle)
0 siblings, 0 replies; only message in thread
From: Matthew Wilcox (Oracle) @ 2024-04-03 17:31 UTC (permalink / raw)
To: Andrew Morton; +Cc: Matthew Wilcox (Oracle), Dan Carpenter, linux-mm
Dan reported I'd messed up some bits vs masks here:
https://lore.kernel.org/linux-fsdevel/1a6dc6a5-b5b6-494c-b94b-f6655da51bb9@moroto.mountain/T/#u
Please add as a fix for "proc: rewrite stable_page_flags()"
---
fs/proc/page.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/proc/page.c b/fs/proc/page.c
index 55b01535eb22..2fb64bdb64eb 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -153,7 +153,7 @@ u64 stable_page_flags(const struct page *page)
* to make sure a given page is a thp, not a non-huge compound page.
*/
else if (folio_test_large(folio)) {
- if ((k & PG_lru) || is_anon)
+ if ((k & (1 << PG_lru)) || is_anon)
u |= 1 << KPF_THP;
else if (is_huge_zero_folio(folio)) {
u |= 1 << KPF_ZERO_PAGE;
@@ -205,7 +205,7 @@ u64 stable_page_flags(const struct page *page)
u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked);
#ifdef CONFIG_MEMORY_FAILURE
- if (u & KPF_HUGE)
+ if (u & (1 << KPF_HUGE))
u |= kpf_copy_bit(k, KPF_HWPOISON, PG_hwpoison);
else
u |= kpf_copy_bit(page->flags, KPF_HWPOISON, PG_hwpoison);
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-03 17:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 17:31 [PATCH] fix-proc-page Matthew Wilcox (Oracle)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox