Maybe we should rename smaps to emaps? After all they include more information than just sizes. So emaps for extended maps would be better. This patch applied on top of mm and requires the the numa_maps-merge-into-smap patch. Signed-off-by: Christoph Lameter Index: linux-2.6.13-rc4/fs/proc/base.c =================================================================== --- linux-2.6.13-rc4.orig/fs/proc/base.c 2005-07-30 09:55:20.000000000 -0700 +++ linux-2.6.13-rc4/fs/proc/base.c 2005-07-30 19:58:09.000000000 -0700 @@ -45,6 +45,9 @@ * * Paul Mundt : * Overall revision about smaps. + * + * Christoph Lameter Silicon Graphics Inc. + * Add NUMA and mapping related output. Renamed to emaps. */ #include @@ -102,7 +105,7 @@ PROC_TGID_NUMA_MAPS, PROC_TGID_MOUNTS, PROC_TGID_WCHAN, - PROC_TGID_SMAPS, + PROC_TGID_EMAPS, #ifdef CONFIG_SCHEDSTATS PROC_TGID_SCHEDSTAT, #endif @@ -141,7 +144,7 @@ PROC_TID_NUMA_MAPS, PROC_TID_MOUNTS, PROC_TID_WCHAN, - PROC_TID_SMAPS, + PROC_TID_EMAPS, #ifdef CONFIG_SCHEDSTATS PROC_TID_SCHEDSTAT, #endif @@ -193,7 +196,7 @@ E(PROC_TGID_ROOT, "root", S_IFLNK|S_IRWXUGO), E(PROC_TGID_EXE, "exe", S_IFLNK|S_IRWXUGO), E(PROC_TGID_MOUNTS, "mounts", S_IFREG|S_IRUGO), - E(PROC_TGID_SMAPS, "smaps", S_IFREG|S_IRUGO), + E(PROC_TGID_EMAPS, "emaps", S_IFREG|S_IRUGO), #ifdef CONFIG_SECURITY E(PROC_TGID_ATTR, "attr", S_IFDIR|S_IRUGO|S_IXUGO), #endif @@ -233,7 +236,7 @@ E(PROC_TID_ROOT, "root", S_IFLNK|S_IRWXUGO), E(PROC_TID_EXE, "exe", S_IFLNK|S_IRWXUGO), E(PROC_TID_MOUNTS, "mounts", S_IFREG|S_IRUGO), - E(PROC_TID_SMAPS, "smaps", S_IFREG|S_IRUGO), + E(PROC_TID_EMAPS, "emaps", S_IFREG|S_IRUGO), #ifdef CONFIG_SECURITY E(PROC_TID_ATTR, "attr", S_IFDIR|S_IRUGO|S_IXUGO), #endif @@ -582,11 +585,11 @@ }; #endif -extern struct seq_operations proc_pid_smaps_op; -static int smaps_open(struct inode *inode, struct file *file) +extern struct seq_operations proc_pid_emaps_op; +static int emaps_open(struct inode *inode, struct file *file) { struct task_struct *task = proc_task(inode); - int ret = seq_open(file, &proc_pid_smaps_op); + int ret = seq_open(file, &proc_pid_emaps_op); if (!ret) { struct seq_file *m = file->private_data; m->private = task; @@ -594,8 +597,8 @@ return ret; } -static struct file_operations proc_smaps_operations = { - .open = smaps_open, +static struct file_operations proc_emaps_operations = { + .open = emaps_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, @@ -1631,9 +1634,9 @@ case PROC_TGID_MOUNTS: inode->i_fop = &proc_mounts_operations; break; - case PROC_TID_SMAPS: - case PROC_TGID_SMAPS: - inode->i_fop = &proc_smaps_operations; + case PROC_TID_EMAPS: + case PROC_TGID_EMAPS: + inode->i_fop = &proc_emaps_operations; break; #ifdef CONFIG_SECURITY case PROC_TID_ATTR: Index: linux-2.6.13-rc4/fs/proc/task_mmu.c =================================================================== --- linux-2.6.13-rc4.orig/fs/proc/task_mmu.c 2005-07-30 19:56:40.000000000 -0700 +++ linux-2.6.13-rc4/fs/proc/task_mmu.c 2005-07-30 19:58:09.000000000 -0700 @@ -164,7 +164,7 @@ unsigned long node[MAX_NUMNODES]; }; -static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, +static void emaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, struct mem_size_stats *mss) { @@ -210,7 +210,7 @@ cond_resched_lock(&vma->vm_mm->page_table_lock); } -static inline void smaps_pmd_range(struct vm_area_struct *vma, pud_t *pud, +static inline void emaps_pmd_range(struct vm_area_struct *vma, pud_t *pud, unsigned long addr, unsigned long end, struct mem_size_stats *mss) { @@ -222,11 +222,11 @@ next = pmd_addr_end(addr, end); if (pmd_none_or_clear_bad(pmd)) continue; - smaps_pte_range(vma, pmd, addr, next, mss); + emaps_pte_range(vma, pmd, addr, next, mss); } while (pmd++, addr = next, addr != end); } -static inline void smaps_pud_range(struct vm_area_struct *vma, pgd_t *pgd, +static inline void emaps_pud_range(struct vm_area_struct *vma, pgd_t *pgd, unsigned long addr, unsigned long end, struct mem_size_stats *mss) { @@ -238,11 +238,11 @@ next = pud_addr_end(addr, end); if (pud_none_or_clear_bad(pud)) continue; - smaps_pmd_range(vma, pud, addr, next, mss); + emaps_pmd_range(vma, pud, addr, next, mss); } while (pud++, addr = next, addr != end); } -static inline void smaps_pgd_range(struct vm_area_struct *vma, +static inline void emaps_pgd_range(struct vm_area_struct *vma, unsigned long addr, unsigned long end, struct mem_size_stats *mss) { @@ -254,11 +254,11 @@ next = pgd_addr_end(addr, end); if (pgd_none_or_clear_bad(pgd)) continue; - smaps_pud_range(vma, pgd, addr, next, mss); + emaps_pud_range(vma, pgd, addr, next, mss); } while (pgd++, addr = next, addr != end); } -static int show_smap(struct seq_file *m, void *v) +static int show_emap(struct seq_file *m, void *v) { struct task_struct *task = m->private; struct vm_area_struct *vma = v; @@ -276,7 +276,7 @@ if (mm) { spin_lock(&mm->page_table_lock); - smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss); + emaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss); spin_unlock(&mm->page_table_lock); } @@ -399,11 +399,11 @@ .show = show_map }; -struct seq_operations proc_pid_smaps_op = { +struct seq_operations proc_pid_emaps_op = { .start = m_start, .next = m_next, .stop = m_stop, - .show = show_smap + .show = show_emap }; #ifdef CONFIG_NUMA