[v2,1/7] fs/proc/page: remove unneeded PageTail && PageSlab check

Message ID 20231110033324.2455523-2-wangkefeng.wang@huawei.com
State New
Headers
Series [v2,1/7] fs/proc/page: remove unneeded PageTail && PageSlab check |

Commit Message

Kefeng Wang Nov. 10, 2023, 3:33 a.m. UTC
  After commit dcb351cd095a ("page-flags: define behavior SL*B-related
flags on compound pages"), the slab could not be a tail, remove unneeded
PageTail && PageSlab check.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 fs/proc/page.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Matthew Wilcox Nov. 10, 2023, 6:11 p.m. UTC | #1
On Fri, Nov 10, 2023 at 11:33:18AM +0800, Kefeng Wang wrote:
> After commit dcb351cd095a ("page-flags: define behavior SL*B-related
> flags on compound pages"), the slab could not be a tail, remove unneeded
> PageTail && PageSlab check.

No, that's completely wrong.

 * PF_NO_TAIL:
 *     modifications of the page flag must be done on small or head pages,
 *     checks can be done on tail pages too.

That's backed up by the code:

#define PF_NO_TAIL(page, enforce) ({                                    \
                VM_BUG_ON_PGFLAGS(enforce && PageTail(page), page);     \
                PF_POISONED_CHECK(compound_head(page)); })

(enforce is set to 0 for the 'test')

> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

NAK
  

Patch

diff --git a/fs/proc/page.c b/fs/proc/page.c
index 195b077c0fac..466efb0dadf7 100644
--- a/fs/proc/page.c
+++ b/fs/proc/page.c
@@ -184,9 +184,6 @@  u64 stable_page_flags(struct page *page)
 	u |= kpf_copy_bit(k, KPF_LOCKED,	PG_locked);
 
 	u |= kpf_copy_bit(k, KPF_SLAB,		PG_slab);
-	if (PageTail(page) && PageSlab(page))
-		u |= 1 << KPF_SLAB;
-
 	u |= kpf_copy_bit(k, KPF_ERROR,		PG_error);
 	u |= kpf_copy_bit(k, KPF_DIRTY,		PG_dirty);
 	u |= kpf_copy_bit(k, KPF_UPTODATE,	PG_uptodate);