Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1517

kernel-2.6.18-238.el5.src.rpm

From: Takao Indoh <tindoh@redhat.com>
Date: Thu, 11 Sep 2008 16:04:16 -0400
Subject: [ia64] procfs: show the size of page table cache
Message-id: 48C979C0.1020101@redhat.com
O-Subject: [RHEL5.3 PATCH 2/2] show the size of page table cache in procfs [v2]
Bugzilla: 458410
RH-Acked-by: Larry Woodman <lwoodman@redhat.com>
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>

The patch I posted at first is adding new line into the middle of
/proc/meminfo, and it's the same as the patch included in upstream.

Larry Woodman pointed out the risk that this patch may break some
applications. The attached new patch is adding new entry /proc/ptcache.
This is different from upstream, but it's safe.

Please review and Ack.

Thanks,
Takao Indoh

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 9421562..9fdc636 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -620,6 +620,18 @@ static int execdomains_read_proc(char *page, char **start, off_t off,
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
+#ifdef CONFIG_IA64
+static int ptcache_read_proc(char *page, char **start, off_t off,
+				 int count, int *eof, void *data)
+{
+	int len;
+
+	len = sprintf(page, "%lu\n", (unsigned long)
+		(pgtable_quicklist_total_size() << (PAGE_SHIFT - 10)));
+	return proc_calc_metrics(page, start, off, count, eof, len);
+}
+#endif
+
 #ifdef CONFIG_MAGIC_SYSRQ
 /*
  * writing 'C' to /proc/sysrq-trigger is like sysrq-C
@@ -673,6 +685,9 @@ void __init proc_misc_init(void)
 		{"cmdline",	cmdline_read_proc},
 		{"locks",	locks_read_proc},
 		{"execdomains",	execdomains_read_proc},
+#ifdef CONFIG_IA64
+		{"ptcache",	ptcache_read_proc},
+#endif
 		{NULL,}
 	};
 	for (p = simple_ones; p->name; p++)