public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] mm/: small cleanups
@ 2005-10-30  1:05 Adrian Bunk
  2005-10-30 14:42 ` Dave Hansen
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2005-10-30  1:05 UTC (permalink / raw)
  To: linux-kernel

This patch contains the following cleanups:
- make some needlessly global functions static
- vmscan.c: #if 0 the unused global function sys_set_zone_reclaim


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 mm/page_alloc.c |   12 +++++++-----
 mm/vmalloc.c    |   12 +++++++-----
 mm/vmscan.c     |    3 +++
 3 files changed, 17 insertions(+), 10 deletions(-)

--- linux-2.6.14-rc5-mm1-full/mm/page_alloc.c.old	2005-10-30 02:35:18.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/mm/page_alloc.c	2005-10-30 02:36:49.000000000 +0200
@@ -393,7 +393,7 @@
 	return ret;
 }
 
-void __free_pages_ok(struct page *page, unsigned int order)
+static void __free_pages_ok(struct page *page, unsigned int order)
 {
 	LIST_HEAD(list);
 	int i;
@@ -1228,7 +1228,8 @@
 DEFINE_PER_CPU(long, nr_pagecache_local) = 0;
 #endif
 
-void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask)
+static void __get_page_state(struct page_state *ret, int nr,
+			     cpumask_t *cpumask)
 {
 	int cpu = 0;
 
@@ -1786,8 +1787,8 @@
 	}
 }
 
-void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
-				unsigned long size)
+static void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
+				 unsigned long size)
 {
 	int order;
 	for (order = 0; order < MAX_ORDER ; order++) {
@@ -1847,7 +1848,8 @@
 	return batch;
 }
 
-inline void setup_pageset(struct per_cpu_pageset *p, unsigned long batch)
+static inline void setup_pageset(struct per_cpu_pageset *p,
+				 unsigned long batch)
 {
 	struct per_cpu_pages *pcp;
 
--- linux-2.6.14-rc5-mm1-full/mm/vmscan.c.old	2005-10-30 02:37:46.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/mm/vmscan.c	2005-10-30 02:38:13.000000000 +0200
@@ -1387,6 +1387,7 @@
 	return total_reclaimed;
 }
 
+#if 0
 asmlinkage long sys_set_zone_reclaim(unsigned int node, unsigned int zone,
 				     unsigned int state)
 {
@@ -1417,3 +1418,5 @@
 
 	return 0;
 }
+#endif  /*  0  */
+
--- linux-2.6.14-rc5-mm1-full/mm/vmalloc.c.old	2005-10-30 02:38:49.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/mm/vmalloc.c	2005-10-30 02:39:42.000000000 +0200
@@ -157,8 +157,10 @@
 	return err;
 }
 
-struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
-				unsigned long start, unsigned long end, int node)
+static struct vm_struct *__get_vm_area_node(unsigned long size,
+					    unsigned long flags,
+					    unsigned long start,
+					    unsigned long end, int node)
 {
 	struct vm_struct **p, *tmp, *area;
 	unsigned long align = 1;
@@ -296,7 +298,7 @@
 	return v;
 }
 
-void __vunmap(void *addr, int deallocate_pages)
+static void __vunmap(void *addr, int deallocate_pages)
 {
 	struct vm_struct *area;
 
@@ -402,8 +404,8 @@
 }
 EXPORT_SYMBOL(vmap);
 
-void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
-				pgprot_t prot, int node)
+static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
+				 pgprot_t prot, int node)
 {
 	struct page **pages;
 	unsigned int nr_pages, array_size, i;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [2.6 patch] mm/: small cleanups
  2005-10-30  1:05 [2.6 patch] mm/: small cleanups Adrian Bunk
@ 2005-10-30 14:42 ` Dave Hansen
  2005-11-07 21:18   ` Adrian Bunk
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Hansen @ 2005-10-30 14:42 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Linux Kernel Mailing List

On Sun, 2005-10-30 at 02:05 +0100, Adrian Bunk wrote:
> This patch contains the following cleanups:
> - make some needlessly global functions static
> - vmscan.c: #if 0 the unused global function sys_set_zone_reclaim

If it's truly unused, why not simply kill it completely?

-- Dave


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [2.6 patch] mm/: small cleanups
  2005-10-30 14:42 ` Dave Hansen
@ 2005-11-07 21:18   ` Adrian Bunk
  2005-11-07 21:27     ` Dave Hansen
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2005-11-07 21:18 UTC (permalink / raw)
  To: Dave Hansen; +Cc: Linux Kernel Mailing List

On Sun, Oct 30, 2005 at 03:42:32PM +0100, Dave Hansen wrote:
> On Sun, 2005-10-30 at 02:05 +0100, Adrian Bunk wrote:
> > This patch contains the following cleanups:
> > - make some needlessly global functions static
> > - vmscan.c: #if 0 the unused global function sys_set_zone_reclaim
> 
> If it's truly unused, why not simply kill it completely?

Updated patch below.

> -- Dave

cu
Adrian


<--  snip  -->


This patch contains the following cleanups:
- make some needlessly global functions static
- vmscan.c: remove the unused global function sys_set_zone_reclaim


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 mm/page_alloc.c |   12 +++++++-----
 mm/vmalloc.c    |   13 +++++++------
 mm/vmscan.c     |   30 ------------------------------
 3 files changed, 14 insertions(+), 41 deletions(-)

--- linux-2.6.14-rc5-mm1-full/mm/page_alloc.c.old	2005-10-30 02:35:18.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/mm/page_alloc.c	2005-10-30 02:36:49.000000000 +0200
@@ -393,7 +393,7 @@
 	return ret;
 }
 
-void __free_pages_ok(struct page *page, unsigned int order)
+static void __free_pages_ok(struct page *page, unsigned int order)
 {
 	LIST_HEAD(list);
 	int i;
@@ -1228,7 +1228,8 @@
 DEFINE_PER_CPU(long, nr_pagecache_local) = 0;
 #endif
 
-void __get_page_state(struct page_state *ret, int nr, cpumask_t *cpumask)
+static void __get_page_state(struct page_state *ret, int nr,
+			     cpumask_t *cpumask)
 {
 	int cpu = 0;
 
@@ -1786,8 +1787,8 @@
 	}
 }
 
-void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
-				unsigned long size)
+static void zone_init_free_lists(struct pglist_data *pgdat, struct zone *zone,
+				 unsigned long size)
 {
 	int order;
 	for (order = 0; order < MAX_ORDER ; order++) {
@@ -1847,7 +1848,8 @@
 	return batch;
 }
 
-inline void setup_pageset(struct per_cpu_pageset *p, unsigned long batch)
+static inline void setup_pageset(struct per_cpu_pageset *p,
+				 unsigned long batch)
 {
 	struct per_cpu_pages *pcp;
 
--- linux-2.6.14-rc5-mm1-full/mm/vmalloc.c.old	2005-10-30 02:38:49.000000000 +0200
+++ linux-2.6.14-rc5-mm1-full/mm/vmalloc.c	2005-10-30 02:39:42.000000000 +0200
@@ -157,8 +157,10 @@
 	return err;
 }
 
-struct vm_struct *__get_vm_area_node(unsigned long size, unsigned long flags,
-				unsigned long start, unsigned long end, int node)
+static struct vm_struct *__get_vm_area_node(unsigned long size,
+					    unsigned long flags,
+					    unsigned long start,
+					    unsigned long end, int node)
 {
 	struct vm_struct **p, *tmp, *area;
 	unsigned long align = 1;
@@ -296,7 +298,7 @@
 	return v;
 }
 
-void __vunmap(void *addr, int deallocate_pages)
+static void __vunmap(void *addr, int deallocate_pages)
 {
 	struct vm_struct *area;
 
@@ -402,8 +404,8 @@
 }
 EXPORT_SYMBOL(vmap);
 
-void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
-				pgprot_t prot, int node)
+static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
+				 pgprot_t prot, int node)
 {
 	struct page **pages;
 	unsigned int nr_pages, array_size, i;

--- linux-2.6.14-mm1-full/mm/vmscan.c.old	2005-11-07 21:11:19.000000000 +0100
+++ linux-2.6.14-mm1-full/mm/vmscan.c	2005-11-07 21:11:43.000000000 +0100
@@ -1605,33 +1605,3 @@
 	return total_reclaimed;
 }
 
-asmlinkage long sys_set_zone_reclaim(unsigned int node, unsigned int zone,
-				     unsigned int state)
-{
-	struct zone *z;
-	int i;
-
-	if (!capable(CAP_SYS_ADMIN))
-		return -EACCES;
-
-	if (node >= MAX_NUMNODES || !node_online(node))
-		return -EINVAL;
-
-	/* This will break if we ever add more zones */
-	if (!(zone & (1<<ZONE_DMA|1<<ZONE_NORMAL|1<<ZONE_HIGHMEM)))
-		return -EINVAL;
-
-	for (i = 0; i < MAX_NR_ZONES; i++) {
-		if (!(zone & 1<<i))
-			continue;
-
-		z = &NODE_DATA(node)->node_zones[i];
-
-		if (state)
-			z->reclaim_pages = 1;
-		else
-			z->reclaim_pages = 0;
-	}
-
-	return 0;
-}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [2.6 patch] mm/: small cleanups
  2005-11-07 21:18   ` Adrian Bunk
@ 2005-11-07 21:27     ` Dave Hansen
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Hansen @ 2005-11-07 21:27 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Linux Kernel Mailing List

On Mon, 2005-11-07 at 22:18 +0100, Adrian Bunk wrote:
> On Sun, Oct 30, 2005 at 03:42:32PM +0100, Dave Hansen wrote:
> > On Sun, 2005-10-30 at 02:05 +0100, Adrian Bunk wrote:
> > > This patch contains the following cleanups:
> > > - make some needlessly global functions static
> > > - vmscan.c: #if 0 the unused global function sys_set_zone_reclaim
> > 
> > If it's truly unused, why not simply kill it completely?
> 
> Updated patch below.

Looks better now.  The net removal of 27 lines makes it much easier to
sell as a cleanup. :)

-- Dave


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-07 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-30  1:05 [2.6 patch] mm/: small cleanups Adrian Bunk
2005-10-30 14:42 ` Dave Hansen
2005-11-07 21:18   ` Adrian Bunk
2005-11-07 21:27     ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox