]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
This interface is primarily useful for doing memory profiling and not much use maps2-patches/maps2-regroup-task_mmu-by-interface.patch
authorMatt Mackall <mpm@selenic.com>
Tue, 6 Jan 2009 12:06:05 +0000 (12:06 +0000)
committerMatt Mackall <mpm@selenic.com>
Tue, 6 Jan 2009 12:06:05 +0000 (12:06 +0000)
on deployed embedded boxes.  Make it optional.  Together with
/proc/pid/clear_refs, this save a few K.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/proc/base.c     |    4 ++++
 fs/proc/task_mmu.c |    2 ++
 init/Kconfig       |    8 ++++++++
 3 files changed, 14 insertions(+)

fs/proc/base.c
fs/proc/task_mmu.c
init/Kconfig

index d930b04594a80b33bcb28fe8057ad7522bb08486..387cdc421394f8675004b40cde8a8a0fdf56833c 100644 (file)
@@ -119,8 +119,10 @@ enum pid_directory_inos {
        PROC_TGID_WCHAN,
 #ifdef CONFIG_MMU
        PROC_TGID_CLEAR_REFS,
+#ifdef CONFIG_PROC_SMAPS
        PROC_TGID_SMAPS,
 #endif
+#endif
 #ifdef CONFIG_SCHEDSTATS
        PROC_TGID_SCHEDSTAT,
 #endif
@@ -166,8 +168,10 @@ enum pid_directory_inos {
        PROC_TID_WCHAN,
 #ifdef CONFIG_MMU
        PROC_TID_CLEAR_REFS,
+#ifdef CONFIG_PROC_SMAPS
        PROC_TID_SMAPS,
 #endif
+#endif
 #ifdef CONFIG_SCHEDSTATS
        PROC_TID_SCHEDSTAT,
 #endif
@@ -230,8 +234,10 @@ static struct pid_entry tgid_base_stuff[] = {
        E(PROC_TGID_MOUNTSTATS, "mountstats", S_IFREG|S_IRUSR),
 #ifdef CONFIG_MMU
        E(PROC_TGID_CLEAR_REFS, "clear_refs", S_IFREG|S_IWUSR),
+#ifdef CONFIG_PROC_SMAPS
        E(PROC_TGID_SMAPS,     "smaps",   S_IFREG|S_IRUSR),
 #endif
+#endif
 #ifdef CONFIG_SECURITY
        E(PROC_TGID_ATTR,      "attr",    S_IFDIR|S_IRUGO|S_IXUGO),
 #endif
@@ -280,8 +286,10 @@ static struct pid_entry tid_base_stuff[] = {
        E(PROC_TID_MOUNTS,     "mounts",  S_IFREG|S_IRUGO),
 #ifdef CONFIG_MMU
        E(PROC_TID_CLEAR_REFS, "clear_refs", S_IFREG|S_IWUSR),
+#ifdef CONFIG_PROC_SMAPS
        E(PROC_TID_SMAPS,      "smaps",   S_IFREG|S_IRUSR),
 #endif
+#endif
 #ifdef CONFIG_SECURITY
        E(PROC_TID_ATTR,       "attr",    S_IFDIR|S_IRUGO|S_IXUGO),
 #endif
@@ -1977,10 +1985,12 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
                case PROC_TGID_CLEAR_REFS:
                        inode->i_fop = &proc_clear_refs_operations;
                        break;
+#ifdef CONFIG_PROC_SMAPS
                case PROC_TID_SMAPS:
                case PROC_TGID_SMAPS:
                        inode->i_fop = &proc_smaps_operations;
                        break;
+#endif
 #endif
                case PROC_TID_MOUNTSTATS:
                case PROC_TGID_MOUNTSTATS:
index 2479a2585a5430d3dde3510097e07968cdf62498..6a88625d2ca3030a2b849f8aaa1e2b48e2c8b104 100644 (file)
@@ -337,6 +337,7 @@ struct file_operations proc_maps_operations = {
        .release        = seq_release_private,
 };
 
+#ifdef CONFIG_PROC_SMAPS
 struct mem_size_stats
 {
        struct vm_area_struct *vma;
@@ -444,6 +445,7 @@ struct file_operations proc_smaps_operations = {
        .llseek         = seq_lseek,
        .release        = seq_release_private,
 };
+#endif
 
 static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr,
                                unsigned long end, void *private)
index 68f973af10b9eb6f8b6062792c32333aee5a07d2..355031356efbbdca94478d6e5a83f372e31a97f5 100644 (file)
@@ -409,6 +409,14 @@ config VM_EVENT_COUNTERS
          option allows the disabling of the VM event counters.
          /proc/vmstat will only show page counts.
 
+config PROC_SMAPS
+       default y
+       bool "Enable /proc/pid/smaps support" if EMBEDDED && PROC_FS && MMU
+       help
+         The /proc/pid/smaps interface reports a process's private and
+          shared memory per mapping. Disabling this interface will reduce
+          the size of the kernel for small machines.
+
 endmenu                # General setup
 
 config RT_MUTEXES