linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/shmem: Fix input and output inconsistencies
@ 2024-06-28  3:23 Bang Li
  2024-06-28  3:32 ` Baolin Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Bang Li @ 2024-06-28  3:23 UTC (permalink / raw)
  To: hughd, akpm
  Cc: baolin.wang, david, ryan.roberts, linux-mm, linux-kernel, Bang Li

After the commit 19eaf44954df ("mm: thp: support allocation of
anonymous multi-size THP"), add mTHP support for anonymous shmem.
We can configure different policies through the multi-size THP
sysfs interface for anonymous shmem.

But when we configure the "advise" policy of
/sys/kernel/mm/transparent_hugepage/hugepages-xxxkB/shmem_enabled,
we cannot write the "advise", but write the "madvise", which is
unreasonable. We should keep the output and input values consistent,
which is more convenient for users.

Fixes: 61a57f1b1da9 ("mm: shmem: add multi-size THP sysfs interface for anonymous shmem")
Signed-off-by: Bang Li <libang.li@antgroup.com>
---
 mm/shmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 13d139abe69a..d495c0701a83 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4983,7 +4983,7 @@ static ssize_t thpsize_shmem_enabled_store(struct kobject *kobj,
 		clear_bit(order, &huge_shmem_orders_madvise);
 		set_bit(order, &huge_shmem_orders_within_size);
 		spin_unlock(&huge_shmem_orders_lock);
-	} else if (sysfs_streq(buf, "madvise")) {
+	} else if (sysfs_streq(buf, "advise")) {
 		spin_lock(&huge_shmem_orders_lock);
 		clear_bit(order, &huge_shmem_orders_always);
 		clear_bit(order, &huge_shmem_orders_inherit);
-- 
2.19.1.6.gb485710b



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-06-28  3:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-28  3:23 [PATCH] mm/shmem: Fix input and output inconsistencies Bang Li
2024-06-28  3:32 ` Baolin Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox