tag namev0.2
Tagged objectcommit 5d87c405cc...
path: root/tools/vm
diff options
authorKonstantin Khlebnikov <>2015-09-08 15:00:10 -0700
committerLinus Torvalds <>2015-09-08 15:35:28 -0700
commit77bb499bb60f4b79cca7d139c8041662860fcf87 (patch)
tree6a1565ab551fcf8c04b4f38c37b085bbf0829da5 /tools/vm
parent1c90308e7a77af6742a97d1021cca923b23b7f0d (diff)
pagemap: add mmap-exclusive bit for marking pages mapped only here
This patch sets bit 56 in pagemap if this page is mapped only once. It allows to detect exclusively used pages without exposing PFN: present file exclusive state 0 0 0 non-present 1 1 0 file page mapped somewhere else 1 1 1 file page mapped only here 1 0 0 anon non-CoWed page (shared with parent/child) 1 0 1 anon CoWed page (or never forked) CoWed pages in (MAP_FILE | MAP_PRIVATE) areas are anon in this context. MMap-exclusive bit doesn't reflect potential page-sharing via swapcache: page could be mapped once but has several swap-ptes which point to it. Application could detect that by swap bit in pagemap entry and touch that pte via /proc/pid/mem to get real information. See Requested by Mark Williamson. [ fix spello] Signed-off-by: Konstantin Khlebnikov <> Reviewed-by: Mark Williamson <> Tested-by: Mark Williamson <> Reviewed-by: Naoya Horiguchi <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'tools/vm')
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c