crazy idea: what if swap, in particular zram (RAM compression), was enhanced with eBPF bytecode invoked during page reclaim? for pages with a single (RW) mapping, you could e.g. ask userspace which subsets of the page must be preserved (if the heap metadata isn't swapped out)
AFAIK madvise() doesn't let you do things like ensure that if the OS compresses a page, it skips free heap chunks. and I think the only thing MADV_WILLNEED does is to swap in pages that are not currently swapped in? I don't think it modifies any LRU state? https://elixir.bootlin.com/linux/latest/source/mm/madvise.c#L272 …
-
-
Wouldn't that just be like having arbitrary-length pages? Could be more efficient to just zero (or some other pattern) out freed memory. Would also work nicely with other things, like kernel samepage mapping.
-
yeah, it'd be vaguely similar to having arbitrary-length pages. yeah, if zeroing heap chunks on free is cheap enough, that might be a much simpler solution. I don't really like KSM, especially for things like heap data, given the side-channel attacks people have done with it
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.