linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] add __meminit for memory hotplug
@ 2006-01-09 15:19 Matt Tolentino
  2006-01-09 15:39 ` Andi Kleen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Matt Tolentino @ 2006-01-09 15:19 UTC (permalink / raw)
  To: ak, akpm; +Cc: discuss, kmannth, linux-kernel

Add __meminit to the __init lineup to ensure functions default
to __init when memory hotplug is not enabled.  Replace __devinit
with __meminit on functions that were changed when the memory
hotplug code was introduced.  

Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com>
---
diff -urNp linux-2.6.15/arch/i386/mm/init.c linux-2.6.15-matt/arch/i386/mm/init.c
--- linux-2.6.15/arch/i386/mm/init.c	2006-01-02 22:21:10.000000000 -0500
+++ linux-2.6.15-matt/arch/i386/mm/init.c	2006-01-06 11:06:44.000000000 -0500
@@ -268,7 +268,7 @@ static void __init permanent_kmaps_init(
 	pkmap_page_table = pte;	
 }
 
-static void __devinit free_new_highpage(struct page *page)
+static void __meminit free_new_highpage(struct page *page)
 {
 	set_page_count(page, 1);
 	__free_page(page);
diff -urNp linux-2.6.15/include/linux/init.h linux-2.6.15-matt/include/linux/init.h
--- linux-2.6.15/include/linux/init.h	2006-01-02 22:21:10.000000000 -0500
+++ linux-2.6.15-matt/include/linux/init.h	2006-01-06 11:04:10.000000000 -0500
@@ -241,6 +241,18 @@ void __init parse_early_param(void);
 #define __cpuexitdata	__exitdata
 #endif
 
+#ifdef CONFIG_MEMORY_HOTPLUG
+#define __meminit
+#define __meminitdata
+#define __memexit
+#define __memexitdata
+#else
+#define __meminit	__init
+#define __meminitdata __initdata
+#define __memexit __exit
+#define __memexitdata	__exitdata
+#endif
+
 /* Functions marked as __devexit may be discarded at kernel link time, depending
    on config options.  Newer versions of binutils detect references from
    retained sections to discarded sections and flag an error.  Pointers to
diff -urNp linux-2.6.15/mm/page_alloc.c linux-2.6.15-matt/mm/page_alloc.c
--- linux-2.6.15/mm/page_alloc.c	2006-01-02 22:21:10.000000000 -0500
+++ linux-2.6.15-matt/mm/page_alloc.c	2006-01-06 11:05:54.000000000 -0500
@@ -1699,7 +1699,7 @@ static void __init calculate_zone_totalp
  * up by free_all_bootmem() once the early boot process is
  * done. Non-atomic initialization, single-pass.
  */
-void __devinit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
+void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
 		unsigned long start_pfn)
 {
 	struct page *page;
@@ -1754,7 +1754,7 @@ void zonetable_add(struct zone *zone, in
 	memmap_init_zone((size), (nid), (zone), (start_pfn))
 #endif
 
-static int __devinit zone_batchsize(struct zone *zone)
+static int __meminit zone_batchsize(struct zone *zone)
 {
 	int batch;
 
@@ -1832,7 +1832,7 @@ static struct per_cpu_pageset
  * Dynamically allocate memory for the
  * per cpu pageset array in struct zone.
  */
-static int __devinit process_zones(int cpu)
+static int __meminit process_zones(int cpu)
 {
 	struct zone *zone, *dzone;
 
@@ -1871,7 +1871,7 @@ static inline void free_zone_pagesets(in
 #endif
 }
 
-static int __devinit pageset_cpuup_callback(struct notifier_block *nfb,
+static int __meminit pageset_cpuup_callback(struct notifier_block *nfb,
 		unsigned long action,
 		void *hcpu)
 {
@@ -1911,7 +1911,7 @@ void __init setup_per_cpu_pageset(void)
 
 #endif
 
-static __devinit
+static __meminit
 void zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
 {
 	int i;
@@ -1931,7 +1931,7 @@ void zone_wait_table_init(struct zone *z
 		init_waitqueue_head(zone->wait_table + i);
 }
 
-static __devinit void zone_pcp_init(struct zone *zone)
+static __meminit void zone_pcp_init(struct zone *zone)
 {
 	int cpu;
 	unsigned long batch = zone_batchsize(zone);
@@ -1949,7 +1949,7 @@ static __devinit void zone_pcp_init(stru
 		zone->name, zone->present_pages, batch);
 }
 
-static __devinit void init_currently_empty_zone(struct zone *zone,
+static __meminit void init_currently_empty_zone(struct zone *zone,
 		unsigned long zone_start_pfn, unsigned long size)
 {
 	struct pglist_data *pgdat = zone->zone_pgdat;

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

* Re: [patch 1/2] add __meminit for memory hotplug
  2006-01-09 15:19 [patch 1/2] add __meminit for memory hotplug Matt Tolentino
@ 2006-01-09 15:39 ` Andi Kleen
  2006-01-09 18:20 ` Dave Hansen
  2006-01-11 19:59 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2006-01-09 15:39 UTC (permalink / raw)
  To: Matt Tolentino; +Cc: akpm, discuss, kmannth, linux-kernel

On Monday 09 January 2006 16:19, Matt Tolentino wrote:

> Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com>
> ---
> diff -urNp linux-2.6.15/arch/i386/mm/init.c linux-2.6.15-matt/arch/i386/mm/init.c
> --- linux-2.6.15/arch/i386/mm/init.c	2006-01-02 22:21:10.000000000 -0500
> +++ linux-2.6.15-matt/arch/i386/mm/init.c	2006-01-06 11:06:44.000000000 -0500

Won't this need an x86-64 specific patch too?   I don't think
any code in x86-64 has __meminit yet.

-Andi

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

* Re: [patch 1/2] add __meminit for memory hotplug
  2006-01-09 15:19 [patch 1/2] add __meminit for memory hotplug Matt Tolentino
  2006-01-09 15:39 ` Andi Kleen
@ 2006-01-09 18:20 ` Dave Hansen
  2006-01-11 19:59 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: Dave Hansen @ 2006-01-09 18:20 UTC (permalink / raw)
  To: Matt Tolentino; +Cc: ak, akpm, discuss, kmannth, linux-kernel

On Mon, 2006-01-09 at 10:19 -0500, Matt Tolentino wrote:
> Add __meminit to the __init lineup to ensure functions default
> to __init when memory hotplug is not enabled.  Replace __devinit
> with __meminit on functions that were changed when the memory
> hotplug code was introduced.  

Ack.  Looks good.  There was a time when people didn't want __YYYYinit,
but we might as well use one while they're proliferating.

-- Dave


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

* Re: [patch 1/2] add __meminit for memory hotplug
  2006-01-09 15:19 [patch 1/2] add __meminit for memory hotplug Matt Tolentino
  2006-01-09 15:39 ` Andi Kleen
  2006-01-09 18:20 ` Dave Hansen
@ 2006-01-11 19:59 ` Pavel Machek
  2 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2006-01-11 19:59 UTC (permalink / raw)
  To: Matt Tolentino; +Cc: ak, akpm, discuss, kmannth, linux-kernel

On Mon 09-01-06 10:19:30, Matt Tolentino wrote:
> Add __meminit to the __init lineup to ensure functions default
> to __init when memory hotplug is not enabled.  Replace __devinit
> with __meminit on functions that were changed when the memory
> hotplug code was introduced.  
> 
> diff -urNp linux-2.6.15/include/linux/init.h linux-2.6.15-matt/include/linux/init.h
> --- linux-2.6.15/include/linux/init.h	2006-01-02 22:21:10.000000000 -0500
> +++ linux-2.6.15-matt/include/linux/init.h	2006-01-06 11:04:10.000000000 -0500
> @@ -241,6 +241,18 @@ void __init parse_early_param(void);
>  #define __cpuexitdata	__exitdata
>  #endif
>  
> +#ifdef CONFIG_MEMORY_HOTPLUG
> +#define __meminit
> +#define __meminitdata
> +#define __memexit
> +#define __memexitdata

You should document these...

-- 
Thanks, Sharp!

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

* RE: [patch 1/2] add __meminit for memory hotplug
@ 2006-01-09 15:48 Tolentino, Matthew E
  0 siblings, 0 replies; 5+ messages in thread
From: Tolentino, Matthew E @ 2006-01-09 15:48 UTC (permalink / raw)
  To: Andi Kleen, Matt Tolentino; +Cc: akpm, discuss, kmannth, linux-kernel

Andi Kleen <mailto:ak@suse.de> wrote:
> On Monday 09 January 2006 16:19, Matt Tolentino wrote:
> 
>> Signed-off-by: Matt Tolentino <matthew.e.tolentino@intel.com> ---
>> diff -urNp linux-2.6.15/arch/i386/mm/init.c
>> linux-2.6.15-matt/arch/i386/mm/init.c ---
>> linux-2.6.15/arch/i386/mm/init.c	2006-01-02 22:21:10.000000000
-0500
>> +++ linux-2.6.15-matt/arch/i386/mm/init.c	2006-01-06
>> 11:06:44.000000000 -0500  
> 
> Won't this need an x86-64 specific patch too?   I don't think
> any code in x86-64 has __meminit yet.

Right, this patch only changes the existing code that is already
in the tree.  For x86-64, these additions are in the hot-add patch.

matt

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

end of thread, other threads:[~2006-01-14  9:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-09 15:19 [patch 1/2] add __meminit for memory hotplug Matt Tolentino
2006-01-09 15:39 ` Andi Kleen
2006-01-09 18:20 ` Dave Hansen
2006-01-11 19:59 ` Pavel Machek
2006-01-09 15:48 Tolentino, Matthew E

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).