Skip to contentSkip to conversation

mm/vmstat.c: possible cleanups

PATCH In review Adrian Bunk 2 participants 6 messages Jul 5, 2007 – Jul 9, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/vmstat.c: possible cleanups

This patch contains the following possible cleanups:
- make the needlessly global setup_vmstat() static
- #if 0 the unused refresh_vm_stats()

---

 mm/vmstat.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
mm/vmstat.c renamed from mm/vmstat.c.old +5 -1
@@ -353,6 +353,8 @@
 	}
 }
 
+#if 0
+
 static void __refresh_cpu_vm_stats(void *dummy)
 {
 	refresh_cpu_vm_stats(smp_processor_id());
@@ -370,6 +372,8 @@
 }
 EXPORT_SYMBOL(refresh_vm_stats);
 
+#endif  /*  0  */
+
 #endif
 
 #ifdef CONFIG_NUMA
@@ -957,7 +961,7 @@
 static struct notifier_block __cpuinitdata vmstat_notifier =
 	{ &vmstat_cpuup_callback, NULL, 0 };
 
-int __init setup_vmstat(void)
+static int __init setup_vmstat(void)
 {
 	int cpu;
 
#1 lore raw
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make the needlessly global setup_vmstat() static

Ok.

Quoted 1 line

- #if 0 the unused refresh_vm_stats()

Hmmm... This may be needed by the cpu idle code to update the vm stats before going idle.

#2 lore raw
Quoted 11 lines · Christoph Lameter
Quoted 2 lines · Adrian Bunk

This patch contains the following possible cleanups:
- make the needlessly global setup_vmstat() static

Ok.

Quoted 1 line

- #if 0 the unused refresh_vm_stats()

Hmmm... This may be needed by the cpu idle code to update the vm stats before going idle.

Since 1 year it's making the kernel image larger without having a single user.

And if it will one day get a user, removing the #if 0 will be trivial.

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 7 lines · Adrian Bunk
Quoted 2 lines

Hmmm... This may be needed by the cpu idle code to update the vm stats before going idle.

Since 1 year it's making the kernel image larger without having a single user.

And if it will one day get a user, removing the #if 0 will be trivial.

Then just remove the whole function. the #if 0 is ugly.

#4 lore raw

PATCH 1/1 mm/vmstat.c: cleanups

Quoted 11 lines · Christoph Lameter
Quoted 7 lines · Adrian Bunk
Quoted 2 lines

Hmmm... This may be needed by the cpu idle code to update the vm stats before going idle.

Since 1 year it's making the kernel image larger without having a single user.

And if it will one day get a user, removing the #if 0 will be trivial.

Then just remove the whole function. the #if 0 is ugly.

Updated patch below.

cu
Adrian

<-- snip -->

This patch contains the following cleanups:
- make the needlessly global setup_vmstat() static
- remove the unused refresh_vm_stats()

---

 mm/vmstat.c |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)
mm/vmstat.c renamed from mm/vmstat.c.old +1 -18
@@ -353,23 +353,6 @@
 	}
 }
 
-static void __refresh_cpu_vm_stats(void *dummy)
-{
-	refresh_cpu_vm_stats(smp_processor_id());
-}
-
-/*
- * Consolidate all counters.
- *
- * Note that the result is less inaccurate but still inaccurate
- * if concurrent processes are allowed to run.
- */
-void refresh_vm_stats(void)
-{
-	on_each_cpu(__refresh_cpu_vm_stats, NULL, 0, 1);
-}
-EXPORT_SYMBOL(refresh_vm_stats);
-
 #endif
 
 #ifdef CONFIG_NUMA
@@ -957,7 +940,7 @@
 static struct notifier_block __cpuinitdata vmstat_notifier =
 	{ &vmstat_cpuup_callback, NULL, 0 };
 
-int __init setup_vmstat(void)
+static int __init setup_vmstat(void)
 {
 	int cpu;