Display vma mlocked state and page counts Pages in mlocked VMAs are not subject to page migration, so its important to know if a VMA was mlocked. Also page counts may indicate xpmem being active in a vma. Signed-off-by: Christoph Lameter Index: linux-2.6.16-rc6/mm/mempolicy.c =================================================================== --- linux-2.6.16-rc6.orig/mm/mempolicy.c 2006-03-11 14:12:55.000000000 -0800 +++ linux-2.6.16-rc6/mm/mempolicy.c 2006-03-17 18:26:05.000000000 -0800 @@ -1758,6 +1776,8 @@ struct numa_maps { unsigned long mapcount_max; unsigned long dirty; unsigned long swapcache; + unsigned long min_pagecount; + unsigned long max_pagecount; unsigned long node[MAX_NUMNODES]; }; @@ -1785,6 +1805,13 @@ static void gather_stats(struct page *pa if (count > md->mapcount_max) md->mapcount_max = count; + count = page_count(page); + if (count > md->max_pagecount) + md->max_pagecount = count; + + if (!md->min_pagecount || count < md->min_pagecount) + md->min_pagecount = count; + md->node[page_to_nid(page)]++; cond_resched(); } @@ -1863,9 +1890,13 @@ int show_numa_map(struct seq_file *m, vo &node_online_map, MPOL_MF_STATS, md); } + if (vma->vm_flags & VM_LOCKED) + seq_printf(m, " locked"); + if (!md->pages) goto out; + if (md->anon) seq_printf(m," anon=%lu",md->anon); @@ -1887,6 +1918,9 @@ int show_numa_map(struct seq_file *m, vo if (md->writeback) seq_printf(m," writeback=%lu", md->writeback); + if (md->min_pagecount > 2 || md->max_pagecount > 1 + md->mapcount_max) + seq_printf(m," pc=%lu-%lu", md->min_pagecount, md->max_pagecount); + for_each_online_node(n) if (md->node[n]) seq_printf(m, " N%d=%lu", n, md->node[n]);