From 9ec136989832a402df450f8a20712e4c176cccf3 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sat, 6 Feb 2016 12:53:01 +0100 Subject: [PATCH] madvise.2: Reorder MAD_FREE entry Signed-off-by: Michael Kerrisk --- man2/madvise.2 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/man2/madvise.2 b/man2/madvise.2 index 583d900e6..b1f4b61d4 100644 --- a/man2/madvise.2 +++ b/man2/madvise.2 @@ -143,25 +143,6 @@ flag are special memory areas that are not managed by the virtual memory subsystem. Such pages are typically created by device drivers that map the pages into user space.) -.TP -.B MADV_FREE " (since Linux 4.5)" -Application is finished with the given range, so kernel can free -resources associated with it but the freeing could be delayed until -memory pressure happens or canceld by write operation by user. - -After a successful MADV_FREE operation, user shouldn't expect kernel -keeps stale data on the page. However, subsequent write of pages -in the range will succeed and then kernel cannot free those dirtied pages -so user can always see just written data. If there was no subsequent -write, kernel can free those clean pages any time. In such case, -user can see zero-fill-on-demand pages. - -Note that, it works only with private anonymous pages (see -.BR mmap (2)). -On swapless system, freeing pages in given range happens instantly -regardless of memory pressure. - - .\" .\" ====================================================================== .\" @@ -380,6 +361,23 @@ file (see .BR MADV_DODUMP " (since Linux 3.4)" Undo the effect of an earlier .BR MADV_DONTDUMP . +.TP +.B MADV_FREE " (since Linux 4.5)" +Application is finished with the given range, so kernel can free +resources associated with it but the freeing could be delayed until +memory pressure happens or canceld by write operation by user. + +After a successful MADV_FREE operation, user shouldn't expect kernel +keeps stale data on the page. However, subsequent write of pages +in the range will succeed and then kernel cannot free those dirtied pages +so user can always see just written data. If there was no subsequent +write, kernel can free those clean pages any time. In such case, +user can see zero-fill-on-demand pages. + +Note that, it works only with private anonymous pages (see +.BR mmap (2)). +On swapless system, freeing pages in given range happens instantly +regardless of memory pressure. .SH RETURN VALUE On success, .BR madvise ()