All of lore.kernel.org
 help / color / mirror / Atom feed
* + fork-zero-vmap-stack-using-clear_pages-instead-of-memset.patch added to mm-nonmm-unstable branch
@ 2026-02-24 17:47 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-02-24 17:47 UTC (permalink / raw)
  To: mm-commits, vschneid, vincent.guittot, vbabka, surenb, rppt,
	rostedt, peterz, pasha.tatashin, mjguzik, mingo, mhocko, mgorman,
	lorenzo.stoakes, liam.howlett, kees, juri.lelli, dietmar.eggemann,
	david, bsegall, ankur.a.arora, linusw, akpm


The patch titled
     Subject: fork: zero vmap stack using clear_pages() instead of memset()
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     fork-zero-vmap-stack-using-clear_pages-instead-of-memset.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/fork-zero-vmap-stack-using-clear_pages-instead-of-memset.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Linus Walleij <linusw@kernel.org>
Subject: fork: zero vmap stack using clear_pages() instead of memset()
Date: Tue, 24 Feb 2026 11:26:32 +0100

After the introduction of clear_pages() we exploit the fact that the
process vm_area is allocated in contiguous pages to just clear them all in
one swift operation.

Link: https://lkml.kernel.org/r/20260224-mm-fork-clear-pages-v1-1-184c65a72d49@kernel.org
Signed-off-by: Linus Walleij <linusw@kernel.org>
Suggested-by: Mateusz Guzik <mjguzik@gmail.com>
Link: https://lore.kernel.org/linux-mm/dpnwsp7dl4535rd7qmszanw6u5an2p74uxfex4dh53frpb7pu3@2bnjjavjrepe/
Suggested-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Link: https://lore.kernel.org/20240311164638.2015063-7-pasha.tatashin@soleen.com
Cc: Ankur Arora <ankur.a.arora@oracle.com>
Cc: Ben Segall <bsegall@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/fork.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/fork.c~fork-zero-vmap-stack-using-clear_pages-instead-of-memset
+++ a/kernel/fork.c
@@ -350,7 +350,7 @@ static int alloc_thread_stack_node(struc
 		stack = kasan_reset_tag(vm_area->addr);
 
 		/* Clear stale pointers from reused stack. */
-		memset(stack, 0, THREAD_SIZE);
+		clear_pages(vm_area->addr, vm_area->nr_pages);
 
 		tsk->stack_vm_area = vm_area;
 		tsk->stack = stack;
_

Patches currently in -mm which might be from linusw@kernel.org are

fork-zero-vmap-stack-using-clear_pages-instead-of-memset.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-02-24 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 17:47 + fork-zero-vmap-stack-using-clear_pages-instead-of-memset.patch added to mm-nonmm-unstable branch Andrew Morton

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.