All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: page_owner: use kstrtobool() to parse bool option
@ 2021-04-01 21:09 Sergei Trofimovich
  2021-04-01 21:43 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Sergei Trofimovich @ 2021-04-01 21:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sergei Trofimovich, linux-mm

I tried to use page_owner=1 for a while noticed too late it had
no effect as opposed to similar init_on_alloc=1 (these work).

Let's make them consistent.

The change decreses binary size slightly:
   text    data     bss     dec     hex filename
  12408     321      17   12746    31ca mm/page_owner.o.before
  12320     321      17   12658    3172 mm/page_owner.o.after

CC: Andrew Morton <akpm@linux-foundation.org>
CC: linux-mm@kvack.org
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 mm/page_owner.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/mm/page_owner.c b/mm/page_owner.c
index d15c7c4994f5..63e4ecaba97b 100644
--- a/mm/page_owner.c
+++ b/mm/page_owner.c
@@ -41,13 +41,7 @@ static void init_early_allocated_pages(void);
 
 static int __init early_page_owner_param(char *buf)
 {
-	if (!buf)
-		return -EINVAL;
-
-	if (strcmp(buf, "on") == 0)
-		page_owner_enabled = true;
-
-	return 0;
+	return kstrtobool(buf, &page_owner_enabled);
 }
 early_param("page_owner", early_page_owner_param);
 
-- 
2.31.1


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

* Re: [PATCH] mm: page_owner: use kstrtobool() to parse bool option
  2021-04-01 21:09 [PATCH] mm: page_owner: use kstrtobool() to parse bool option Sergei Trofimovich
@ 2021-04-01 21:43 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2021-04-01 21:43 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: Andrew Morton, linux-kernel, linux-mm

On Thu, Apr 01, 2021 at 10:09:09PM +0100, Sergei Trofimovich wrote:
> I tried to use page_owner=1 for a while noticed too late it had
> no effect as opposed to similar init_on_alloc=1 (these work).
> 
> Let's make them consistent.
> 
> The change decreses binary size slightly:
>    text    data     bss     dec     hex filename
>   12408     321      17   12746    31ca mm/page_owner.o.before
>   12320     321      17   12658    3172 mm/page_owner.o.after
> 
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: linux-mm@kvack.org
> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Seems to me there are a few other places that could benefit from this.

kmemleak_boot_config()
early_kasan_flag()
early_kasan_flag_stacktrace()
nonx32_setup()

maybe others?  grep is our friend.

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

end of thread, other threads:[~2021-04-01 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 21:09 [PATCH] mm: page_owner: use kstrtobool() to parse bool option Sergei Trofimovich
2021-04-01 21:43 ` Matthew Wilcox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.