mirror of https://github.com/mkerrisk/man-pages
madvise.2: Reorder MAD_FREE entry
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
cbb9ef3061
commit
9ec1369898
|
@ -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 ()
|
||||
|
|
Loading…
Reference in New Issue