Hacker News new | ask | show | jobs
by jcranmer 873 days ago
No, it's specifically a write that causes the page to actually be freed. Per the man page:

> However, subsequent writes to pages in the range will succeed and then kernel cannot free those dirtied pages, so that the caller can always see just written data. If there is no subsequent write, the kernel can free the pages at any time. Once pages in the range have been freed, the caller will see zero-fill-on-demand pages upon subsequent page references.

1 comments

Ah, I mixed up MADV_DONTNEED (which is older) with MADV_FREE.