mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
criu/proc_parse: support MADV_WIPEONFORK/VM_WIPEONFORK
Support VM_WIPEONFORK [1] by detecting it from /proc/<pid>/smaps
and setting a corresponding MADV_WIPEONFORK flag on vma.
[1] d2cd9ede6e
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
This commit is contained in:
parent
2b8951a9cf
commit
af5412a433
2 changed files with 5 additions and 0 deletions
|
|
@ -13,5 +13,8 @@
|
|||
#ifndef MADV_DONTDUMP
|
||||
#define MADV_DONTDUMP 16
|
||||
#endif
|
||||
#ifndef MADV_WIPEONFORK
|
||||
#define MADV_WIPEONFORK 18
|
||||
#endif
|
||||
|
||||
#endif /* __CR_MMAN_H__ */
|
||||
|
|
|
|||
|
|
@ -160,6 +160,8 @@ static void __parse_vmflags(char *buf, u32 *flags, u64 *madv, int *io_pf,
|
|||
*madv |= (1ul << MADV_HUGEPAGE);
|
||||
else if (_vmflag_match(tok, "nh"))
|
||||
*madv |= (1ul << MADV_NOHUGEPAGE);
|
||||
else if (_vmflag_match(tok, "wf"))
|
||||
*madv |= (1ul << MADV_WIPEONFORK);
|
||||
|
||||
/* vmsplice doesn't work for VM_IO and VM_PFNMAP mappings. */
|
||||
if (_vmflag_match(tok, "io") || _vmflag_match(tok, "pf"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue