linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mm: Add MADV_NONZERO to skip redundant zeroing in MADV_DONTNEED
@ 2025-06-04  1:01 Ayaan Mirza Baig
  2025-06-04  1:49 ` Harry Yoo
  0 siblings, 1 reply; 3+ messages in thread
From: Ayaan Mirza Baig @ 2025-06-04  1:01 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, david

Hi Andrew,

I've been looking at MADV_DONTNEED and noticed we always zero pages, 
even when
it might not be necessary for cases like:

- Media buffers (video/audio processing)
- Temporary compute workloads
- Pre-zeroed memory pools

This causes measurable overhead - in some synthetic tests I'm seeing 
~40% extra
latency from the zeroing. I'm thinking of adding a MADV_NONZERO flag 
that would
let us skip the zeroing when:

1. It's explicitly requested (MADV_DONTNEED|MADV_NONZERO)
2. We're confident it's safe (VM_IO, VM_HUGETLB, etc)
3. The user has explicitly marked the region as non-sensitive

Before I go deeper on patches, I wanted to check:
- Does this sound reasonable?
- Any obvious security holes I'm missing?
- Would you prefer a new flag or a separate advice type?

Early prototype numbers look promising, but I want to make sure I'm not 
missing
something fundamental. If the concept seems viable, I'll work up proper 
benchmarks
and formal patches.

Thanks for your time!
- Ayaan Mirza Baig


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

end of thread, other threads:[~2025-06-04 11:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-04  1:01 [RFC] mm: Add MADV_NONZERO to skip redundant zeroing in MADV_DONTNEED Ayaan Mirza Baig
2025-06-04  1:49 ` Harry Yoo
2025-06-04 11:27   ` David Hildenbrand

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