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)
-
Show this thread
-
Replying to @tehjh
couldn't you express most of this with madvise(..., MADV_WILLNEED) already?
1 reply 0 retweets 0 likes -
Replying to @damienmiller
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 …
1 reply 0 retweets 1 like -
Replying to @tehjh @damienmiller
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.
1 reply 0 retweets 0 likes
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
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.