public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH 0/3] KASAN: HW_TAGS: Disable tagging for stack and page-tables
@ 2026-03-19 11:49 Muhammad Usama Anjum
  2026-03-19 11:49 ` [PATCH 1/3] vmalloc: add __GFP_SKIP_KASAN support Muhammad Usama Anjum
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Muhammad Usama Anjum @ 2026-03-19 11:49 UTC (permalink / raw)
  To: Arnd Bergmann, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, Kees Cook, Andrew Morton,
	David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Uladzislau Rezki, linux-arch, linux-kernel, linux-mm,
	Andrey Konovalov, Marco Elver, Vincenzo Frascino,
	Peter Collingbourne, Catalin Marinas, Will Deacon, Ryan.Roberts,
	david.hildenbrand
  Cc: Muhammad Usama Anjum

Stacks and page tables are always accessed with the match‑all tag,
so assigning a new random tag every time at allocation and setting
invalid tag at deallocation time, just adds overhead without improving
the detection.

With __GFP_SKIP_KASAN the page keeps its poison tag and KASAN_TAG_KERNEL
(match-all tag) is stored in the page flags while keeping the poison tag
in the hardware. The benefit of it is that 256 tag setting instruction
per 4 kB page aren't needed at allocation and deallocation time.

Thus match‑all pointers still work, while non‑match tags (other than
poison tag) still fault.

__GFP_SKIP_KASAN only skips for KASAN_HW_TAGS mode, so coverage is
unchanged.

Benchmark:
The benchmark has two modes. In thread mode, the child process forks
and creates N threads. In pgtable mode, the parent maps and faults a
specified memory size and then forks repeatedly with children exiting
immediately.

Thread benchmark:
2000 iterations, 2000 threads:	2.575 s → 2.229 s (~13.4% faster)

The pgtable samples:
- 2048 MB, 2000 iters		19.08 s → 17.62 s (~7.6% faster)

Muhammad Usama Anjum (3):
  vmalloc: add __GFP_SKIP_KASAN support
  fork: skip MTE tagging for kernel stacks
  mm: SKIP KASAN for page table allocations

 include/asm-generic/pgalloc.h | 2 +-
 kernel/fork.c                 | 8 +++++---
 mm/vmalloc.c                  | 8 ++++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

-- 
2.47.3



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

end of thread, other threads:[~2026-03-26 13:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 11:49 [PATCH 0/3] KASAN: HW_TAGS: Disable tagging for stack and page-tables Muhammad Usama Anjum
2026-03-19 11:49 ` [PATCH 1/3] vmalloc: add __GFP_SKIP_KASAN support Muhammad Usama Anjum
2026-03-19 12:22   ` Ryan Roberts
2026-03-19 12:57     ` Muhammad Usama Anjum
2026-03-19 11:49 ` [PATCH 2/3] fork: skip MTE tagging for kernel stacks Muhammad Usama Anjum
2026-03-19 12:09   ` Ryan Roberts
2026-03-19 12:29     ` Muhammad Usama Anjum
2026-03-19 11:49 ` [PATCH 3/3] mm: SKIP KASAN for page table allocations Muhammad Usama Anjum
2026-03-19 12:09   ` Ryan Roberts
2026-03-20  3:10 ` [PATCH 0/3] KASAN: HW_TAGS: Disable tagging for stack and page-tables Andrew Morton
2026-03-23 14:53   ` Muhammad Usama Anjum
2026-03-20  8:53 ` David Hildenbrand (Arm)
2026-03-23 15:06   ` Muhammad Usama Anjum
2026-03-26 13:40     ` David Hildenbrand (Arm)

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