diff options
author | Nikanth Karthikesan <knikanth@suse.de> | 2011-01-13 18:45:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:33 -0500 |
commit | 2d90508f638241a2e7422d884767398296ebe720 (patch) | |
tree | 5b80c4919d924ab76c02b629465cbc7820010a53 /fs | |
parent | 62c70bce8ac236514c610020bb1ae5b8bde965cb (diff) |
mm: smaps: export mlock information
Currently there is no way to find whether a process has locked its pages
in memory or not. And which of the memory regions are locked in memory.
Add a new field "Locked" to export this information via the smaps file.
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com>
Acked-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/proc/task_mmu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index c3755bd8dd3e..60b914860f81 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -418,7 +418,8 @@ static int show_smap(struct seq_file *m, void *v) | |||
418 | "Anonymous: %8lu kB\n" | 418 | "Anonymous: %8lu kB\n" |
419 | "Swap: %8lu kB\n" | 419 | "Swap: %8lu kB\n" |
420 | "KernelPageSize: %8lu kB\n" | 420 | "KernelPageSize: %8lu kB\n" |
421 | "MMUPageSize: %8lu kB\n", | 421 | "MMUPageSize: %8lu kB\n" |
422 | "Locked: %8lu kB\n", | ||
422 | (vma->vm_end - vma->vm_start) >> 10, | 423 | (vma->vm_end - vma->vm_start) >> 10, |
423 | mss.resident >> 10, | 424 | mss.resident >> 10, |
424 | (unsigned long)(mss.pss >> (10 + PSS_SHIFT)), | 425 | (unsigned long)(mss.pss >> (10 + PSS_SHIFT)), |
@@ -430,7 +431,9 @@ static int show_smap(struct seq_file *m, void *v) | |||
430 | mss.anonymous >> 10, | 431 | mss.anonymous >> 10, |
431 | mss.swap >> 10, | 432 | mss.swap >> 10, |
432 | vma_kernel_pagesize(vma) >> 10, | 433 | vma_kernel_pagesize(vma) >> 10, |
433 | vma_mmu_pagesize(vma) >> 10); | 434 | vma_mmu_pagesize(vma) >> 10, |
435 | (vma->vm_flags & VM_LOCKED) ? | ||
436 | (unsigned long)(mss.pss >> (10 + PSS_SHIFT)) : 0); | ||
434 | 437 | ||
435 | if (m->count < m->size) /* vma is copied successfully */ | 438 | if (m->count < m->size) /* vma is copied successfully */ |
436 | m->version = (vma != get_gate_vma(task)) ? vma->vm_start : 0; | 439 | m->version = (vma != get_gate_vma(task)) ? vma->vm_start : 0; |