2004-06-28 04:55:37

by Dave Airlie

[permalink] [raw]
Subject: showing locked vms in /proc/pid/maps..


I wanted to know if my VMs were being locked correctly so I through
together this patch for /proc/pid/maps it overloads the read bit with a
capital R for read/locked and an l for non-read/locked..

I'm not sure if this or something like it could be included maybe I'd be
better off overloading the p/s bit with P/S .. or adding a locked field
(didn't like that idea as it might mess up the layout..)..

Dave.

--- ../linux-2.6.4/fs/proc/task_mmu.c 2004-03-15 14:16:06.000000000 +1100
+++ fs/proc/task_mmu.c 2004-06-28 14:45:10.000000000 +1000
@@ -94,7 +94,7 @@
seq_printf(m, "%08lx-%08lx %c%c%c%c %08lx %02x:%02x %lu %n",
map->vm_start,
map->vm_end,
- flags & VM_READ ? 'r' : '-',
+ flags & VM_LOCKED ? (flags & VM_READ ? 'R' : 'l') : (flags & VM_READ ? 'r' : '-'),
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
flags & VM_MAYSHARE ? 's' : 'p',