2012-11-12 16:34:21

by Joonsoo Kim

[permalink] [raw]
Subject: [PATCH 1/4] bootmem: remove not implemented function call, bootmem_arch_preferred_node()

There is no implementation of bootmeme_arch_preferred_node() and
call for this function will makes compile-error.
So, remove it.

Signed-off-by: Joonsoo Kim <[email protected]>

diff --git a/mm/bootmem.c b/mm/bootmem.c
index 434be4a..6f62c03e 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -589,19 +589,6 @@ static void * __init alloc_arch_preferred_bootmem(bootmem_data_t *bdata,
{
if (WARN_ON_ONCE(slab_is_available()))
return kzalloc(size, GFP_NOWAIT);
-
-#ifdef CONFIG_HAVE_ARCH_BOOTMEM
- {
- bootmem_data_t *p_bdata;
-
- p_bdata = bootmem_arch_preferred_node(bdata, size, align,
- goal, limit);
- if (p_bdata)
- return alloc_bootmem_bdata(p_bdata, size, align,
- goal, limit);
- }
-#endif
- return NULL;
}

static void * __init alloc_bootmem_core(unsigned long size,
--
1.7.9.5


2012-11-12 16:34:27

by Joonsoo Kim

[permalink] [raw]
Subject: [PATCH 2/4] avr32, kconfig: remove HAVE_ARCH_BOOTMEM

Now, there is no code for CONFIG_HAVE_ARCH_BOOTMEM.
So remove it.

Cc: Haavard Skinnemoen <[email protected]>
Cc: Hans-Christian Egtvedt <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 06e73bf..c2bbc9a 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -193,9 +193,6 @@ source "kernel/Kconfig.preempt"
config QUICKLIST
def_bool y

-config HAVE_ARCH_BOOTMEM
- def_bool n
-
config ARCH_HAVE_MEMORY_PRESENT
def_bool n

--
1.7.9.5

2012-11-12 16:34:32

by Joonsoo Kim

[permalink] [raw]
Subject: [PATCH 3/4] bootmem: remove alloc_arch_preferred_bootmem()

The name of function is not suitable for now.
And removing function and inlining it's code to each call sites
makes code more understandable.

Additionally, we shouldn't do allocation from bootmem
when slab_is_available(), so directly return kmalloc*'s return value.

Signed-off-by: Joonsoo Kim <[email protected]>

diff --git a/mm/bootmem.c b/mm/bootmem.c
index 6f62c03e..cd5c5a2 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -583,14 +583,6 @@ find_block:
return NULL;
}

-static void * __init alloc_arch_preferred_bootmem(bootmem_data_t *bdata,
- unsigned long size, unsigned long align,
- unsigned long goal, unsigned long limit)
-{
- if (WARN_ON_ONCE(slab_is_available()))
- return kzalloc(size, GFP_NOWAIT);
-}
-
static void * __init alloc_bootmem_core(unsigned long size,
unsigned long align,
unsigned long goal,
@@ -599,9 +591,8 @@ static void * __init alloc_bootmem_core(unsigned long size,
bootmem_data_t *bdata;
void *region;

- region = alloc_arch_preferred_bootmem(NULL, size, align, goal, limit);
- if (region)
- return region;
+ if (WARN_ON_ONCE(slab_is_available()))
+ return kzalloc(size, GFP_NOWAIT);

list_for_each_entry(bdata, &bdata_list, list) {
if (goal && bdata->node_low_pfn <= PFN_DOWN(goal))
@@ -699,11 +690,9 @@ void * __init ___alloc_bootmem_node_nopanic(pg_data_t *pgdat,
{
void *ptr;

+ if (WARN_ON_ONCE(slab_is_available()))
+ return kzalloc(size, GFP_NOWAIT);
again:
- ptr = alloc_arch_preferred_bootmem(pgdat->bdata, size,
- align, goal, limit);
- if (ptr)
- return ptr;

/* do not panic in alloc_bootmem_bdata() */
if (limit && goal + size > limit)
--
1.7.9.5

2012-11-12 16:34:36

by Joonsoo Kim

[permalink] [raw]
Subject: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

It is somehow strange that alloc_bootmem return virtual address
and free_bootmem require physical address.
Anyway, free_bootmem()'s first parameter should be physical address.

There are some call sites for free_bootmem() with virtual address.
So fix them.

Cc: Andrew Morton <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Joonsoo Kim <[email protected]>

diff --git a/arch/powerpc/platforms/cell/celleb_pci.c b/arch/powerpc/platforms/cell/celleb_pci.c
index abc8af4..1735681 100644
--- a/arch/powerpc/platforms/cell/celleb_pci.c
+++ b/arch/powerpc/platforms/cell/celleb_pci.c
@@ -401,11 +401,11 @@ error:
} else {
if (config && *config) {
size = 256;
- free_bootmem((unsigned long)(*config), size);
+ free_bootmem(__pa(*config), size);
}
if (res && *res) {
size = sizeof(struct celleb_pci_resource);
- free_bootmem((unsigned long)(*res), size);
+ free_bootmem(__pa(*res), size);
}
}

diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 7d5a6b4..1963680 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -565,7 +565,7 @@ fail_msg_node:
fail_db_node:
of_node_put(smu->db_node);
fail_bootmem:
- free_bootmem((unsigned long)smu, sizeof(struct smu_device));
+ free_bootmem(__pa(smu), sizeof(struct smu_device));
smu = NULL;
fail_np:
of_node_put(np);
diff --git a/lib/cpumask.c b/lib/cpumask.c
index 402a54a..d327b87 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -161,6 +161,6 @@ EXPORT_SYMBOL(free_cpumask_var);
*/
void __init free_bootmem_cpumask_var(cpumask_var_t mask)
{
- free_bootmem((unsigned long)mask, cpumask_size());
+ free_bootmem(__pa(mask), cpumask_size());
}
#endif
--
1.7.9.5

Subject: Re: [PATCH 2/4] avr32, kconfig: remove HAVE_ARCH_BOOTMEM

Around Tue 13 Nov 2012 01:31:53 +0900 or thereabout, Joonsoo Kim wrote:
> Now, there is no code for CONFIG_HAVE_ARCH_BOOTMEM.
> So remove it.

Indeed, thanks for cleaning. In a not too distant future I'll re-establish
the AVR32 tree on kernel.org, I'm just waiting for my account to be
made/enabled again.

> Cc: Haavard Skinnemoen <[email protected]>
> Cc: Hans-Christian Egtvedt <[email protected]>
> Signed-off-by: Joonsoo Kim <[email protected]>

Acked-by: Hans-Christian Egtvedt <[email protected]>

<snipp diff>

--
mvh
Hans-Christian Egtvedt

2012-11-12 23:23:45

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

On Tue, 13 Nov 2012 01:31:55 +0900
Joonsoo Kim <[email protected]> wrote:

> It is somehow strange that alloc_bootmem return virtual address
> and free_bootmem require physical address.
> Anyway, free_bootmem()'s first parameter should be physical address.
>
> There are some call sites for free_bootmem() with virtual address.
> So fix them.

Well gee, I wonder how that happened :(


How does this look?

From: Andrew Morton <[email protected]>
Subject: bootmem-fix-wrong-call-parameter-for-free_bootmem-fix

improve free_bootmem() and free_bootmem_pate() documentation

Cc: Benjamin Herrenschmidt <[email protected]>
Cc: FUJITA Tomonori <[email protected]>
Cc: Haavard Skinnemoen <[email protected]>
Cc: Hans-Christian Egtvedt <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

include/linux/bootmem.h | 4 ++--
mm/bootmem.c | 20 ++++++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)

--- a/mm/bootmem.c~bootmem-fix-wrong-call-parameter-for-free_bootmem-fix
+++ a/mm/bootmem.c
@@ -147,21 +147,21 @@ unsigned long __init init_bootmem(unsign

/*
* free_bootmem_late - free bootmem pages directly to page allocator
- * @addr: starting address of the range
+ * @addr: starting physical address of the range
* @size: size of the range in bytes
*
* This is only useful when the bootmem allocator has already been torn
* down, but we are still initializing the system. Pages are given directly
* to the page allocator, no bootmem metadata is updated because it is gone.
*/
-void __init free_bootmem_late(unsigned long addr, unsigned long size)
+void __init free_bootmem_late(unsigned long physaddr, unsigned long size)
{
unsigned long cursor, end;

- kmemleak_free_part(__va(addr), size);
+ kmemleak_free_part(__va(physaddr), size);

- cursor = PFN_UP(addr);
- end = PFN_DOWN(addr + size);
+ cursor = PFN_UP(physaddr);
+ end = PFN_DOWN(physaddr + size);

for (; cursor < end; cursor++) {
__free_pages_bootmem(pfn_to_page(cursor), 0);
@@ -385,21 +385,21 @@ void __init free_bootmem_node(pg_data_t

/**
* free_bootmem - mark a page range as usable
- * @addr: starting address of the range
+ * @addr: starting physical address of the range
* @size: size of the range in bytes
*
* Partial pages will be considered reserved and left as they are.
*
* The range must be contiguous but may span node boundaries.
*/
-void __init free_bootmem(unsigned long addr, unsigned long size)
+void __init free_bootmem(unsigned long physaddr, unsigned long size)
{
unsigned long start, end;

- kmemleak_free_part(__va(addr), size);
+ kmemleak_free_part(__va(physaddr), size);

- start = PFN_UP(addr);
- end = PFN_DOWN(addr + size);
+ start = PFN_UP(physaddr);
+ end = PFN_DOWN(physaddr + size);

mark_bootmem(start, end, 0, 0);
}
--- a/include/linux/bootmem.h~bootmem-fix-wrong-call-parameter-for-free_bootmem-fix
+++ a/include/linux/bootmem.h
@@ -51,8 +51,8 @@ extern unsigned long free_all_bootmem(vo
extern void free_bootmem_node(pg_data_t *pgdat,
unsigned long addr,
unsigned long size);
-extern void free_bootmem(unsigned long addr, unsigned long size);
-extern void free_bootmem_late(unsigned long addr, unsigned long size);
+extern void free_bootmem(unsigned long physaddr, unsigned long size);
+extern void free_bootmem_late(unsigned long physaddr, unsigned long size);

/*
* Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
_

2012-11-13 00:36:24

by Joonsoo Kim

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

Hi, Andrew.

2012/11/13 Andrew Morton <[email protected]>:
> On Tue, 13 Nov 2012 01:31:55 +0900
> Joonsoo Kim <[email protected]> wrote:
>
>> It is somehow strange that alloc_bootmem return virtual address
>> and free_bootmem require physical address.
>> Anyway, free_bootmem()'s first parameter should be physical address.
>>
>> There are some call sites for free_bootmem() with virtual address.
>> So fix them.
>
> Well gee, I wonder how that happened :(
>
>
> How does this look?
>
> From: Andrew Morton <[email protected]>
> Subject: bootmem-fix-wrong-call-parameter-for-free_bootmem-fix
>
> improve free_bootmem() and free_bootmem_pate() documentation
>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Cc: FUJITA Tomonori <[email protected]>
> Cc: Haavard Skinnemoen <[email protected]>
> Cc: Hans-Christian Egtvedt <[email protected]>
> Cc: Johannes Weiner <[email protected]>
> Cc: Joonsoo Kim <[email protected]>
> Signed-off-by: Andrew Morton <[email protected]>
> ---
>
> include/linux/bootmem.h | 4 ++--
> mm/bootmem.c | 20 ++++++++++----------
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
> --- a/mm/bootmem.c~bootmem-fix-wrong-call-parameter-for-free_bootmem-fix
> +++ a/mm/bootmem.c
> @@ -147,21 +147,21 @@ unsigned long __init init_bootmem(unsign
>
> /*
> * free_bootmem_late - free bootmem pages directly to page allocator
> - * @addr: starting address of the range
> + * @addr: starting physical address of the range
> * @size: size of the range in bytes
> *
> * This is only useful when the bootmem allocator has already been torn
> * down, but we are still initializing the system. Pages are given directly
> * to the page allocator, no bootmem metadata is updated because it is gone.
> */
> -void __init free_bootmem_late(unsigned long addr, unsigned long size)
> +void __init free_bootmem_late(unsigned long physaddr, unsigned long size)
> {
> unsigned long cursor, end;
>
> - kmemleak_free_part(__va(addr), size);
> + kmemleak_free_part(__va(physaddr), size);
>
> - cursor = PFN_UP(addr);
> - end = PFN_DOWN(addr + size);
> + cursor = PFN_UP(physaddr);
> + end = PFN_DOWN(physaddr + size);
>
> for (; cursor < end; cursor++) {
> __free_pages_bootmem(pfn_to_page(cursor), 0);
> @@ -385,21 +385,21 @@ void __init free_bootmem_node(pg_data_t
>
> /**
> * free_bootmem - mark a page range as usable
> - * @addr: starting address of the range
> + * @addr: starting physical address of the range
> * @size: size of the range in bytes
> *
> * Partial pages will be considered reserved and left as they are.
> *
> * The range must be contiguous but may span node boundaries.
> */
> -void __init free_bootmem(unsigned long addr, unsigned long size)
> +void __init free_bootmem(unsigned long physaddr, unsigned long size)
> {
> unsigned long start, end;
>
> - kmemleak_free_part(__va(addr), size);
> + kmemleak_free_part(__va(physaddr), size);
>
> - start = PFN_UP(addr);
> - end = PFN_DOWN(addr + size);
> + start = PFN_UP(physaddr);
> + end = PFN_DOWN(physaddr + size);
>
> mark_bootmem(start, end, 0, 0);
> }
> --- a/include/linux/bootmem.h~bootmem-fix-wrong-call-parameter-for-free_bootmem-fix
> +++ a/include/linux/bootmem.h
> @@ -51,8 +51,8 @@ extern unsigned long free_all_bootmem(vo
> extern void free_bootmem_node(pg_data_t *pgdat,
> unsigned long addr,
> unsigned long size);
> -extern void free_bootmem(unsigned long addr, unsigned long size);
> -extern void free_bootmem_late(unsigned long addr, unsigned long size);
> +extern void free_bootmem(unsigned long physaddr, unsigned long size);
> +extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
>
> /*
> * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
> _

Looks good to me :)

2012-11-13 00:49:55

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 1/4] bootmem: remove not implemented function call, bootmem_arch_preferred_node()

On Tue, Nov 13, 2012 at 01:31:52AM +0900, Joonsoo Kim wrote:
> There is no implementation of bootmeme_arch_preferred_node() and
> call for this function will makes compile-error.
> So, remove it.
>
> Signed-off-by: Joonsoo Kim <[email protected]>

Acked-by: Johannes Weiner <[email protected]>

2012-11-13 00:50:38

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 2/4] avr32, kconfig: remove HAVE_ARCH_BOOTMEM

On Tue, Nov 13, 2012 at 01:31:53AM +0900, Joonsoo Kim wrote:
> Now, there is no code for CONFIG_HAVE_ARCH_BOOTMEM.
> So remove it.
>
> Cc: Haavard Skinnemoen <[email protected]>
> Cc: Hans-Christian Egtvedt <[email protected]>
> Signed-off-by: Joonsoo Kim <[email protected]>

Acked-by: Johannes Weiner <[email protected]>

2012-11-13 00:55:49

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 3/4] bootmem: remove alloc_arch_preferred_bootmem()

On Tue, Nov 13, 2012 at 01:31:54AM +0900, Joonsoo Kim wrote:
> The name of function is not suitable for now.
> And removing function and inlining it's code to each call sites
> makes code more understandable.
>
> Additionally, we shouldn't do allocation from bootmem
> when slab_is_available(), so directly return kmalloc*'s return value.
>
> Signed-off-by: Joonsoo Kim <[email protected]>

Acked-by: Johannes Weiner <[email protected]>

2012-11-13 00:58:35

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

On Tue, Nov 13, 2012 at 01:31:55AM +0900, Joonsoo Kim wrote:
> It is somehow strange that alloc_bootmem return virtual address
> and free_bootmem require physical address.
> Anyway, free_bootmem()'s first parameter should be physical address.
>
> There are some call sites for free_bootmem() with virtual address.
> So fix them.
>
> Cc: Andrew Morton <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Signed-off-by: Joonsoo Kim <[email protected]>

Acked-by: Johannes Weiner <[email protected]>

2012-11-13 01:10:37

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

On Tue, Nov 13, 2012 at 01:31:55AM +0900, Joonsoo Kim wrote:
> It is somehow strange that alloc_bootmem return virtual address
> and free_bootmem require physical address.
> Anyway, free_bootmem()'s first parameter should be physical address.
>
> There are some call sites for free_bootmem() with virtual address.
> So fix them.
>
> Cc: Andrew Morton <[email protected]>
> Cc: Benjamin Herrenschmidt <[email protected]>
> Signed-off-by: Joonsoo Kim <[email protected]>

Found another one, attached below. The free_bootmem() in
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c looks also fishy, since
it's applied to memory from kzalloc(). Ben?

Signed-off-by: Johannes Weiner <[email protected]>
---

diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 7d5a6b4..1963680 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -565,7 +565,7 @@ int __init smu_init (void)
fail_db_node:
of_node_put(smu->db_node);
fail_bootmem:
- free_bootmem((unsigned long)smu, sizeof(struct smu_device));
+ free_bootmem(__pa(smu), sizeof(struct smu_device));
smu = NULL;
fail_np:
of_node_put(np);

2012-11-13 01:13:34

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

On Mon, Nov 12, 2012 at 08:10:27PM -0500, Johannes Weiner wrote:
> On Tue, Nov 13, 2012 at 01:31:55AM +0900, Joonsoo Kim wrote:
> > It is somehow strange that alloc_bootmem return virtual address
> > and free_bootmem require physical address.
> > Anyway, free_bootmem()'s first parameter should be physical address.
> >
> > There are some call sites for free_bootmem() with virtual address.
> > So fix them.
> >
> > Cc: Andrew Morton <[email protected]>
> > Cc: Benjamin Herrenschmidt <[email protected]>
> > Signed-off-by: Joonsoo Kim <[email protected]>
>
> Found another one, attached below. The free_bootmem() in
> arch/powerpc/platforms/82xx/pq2ads-pci-pic.c looks also fishy, since
> it's applied to memory from kzalloc(). Ben?

Eh, missed the smu.c one in Joonsoo's patch. powerpc one still
strange.

2012-11-13 01:24:51

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH 4/4] bootmem: fix wrong call parameter for free_bootmem()

On Mon, Nov 12, 2012 at 03:23:42PM -0800, Andrew Morton wrote:
> On Tue, 13 Nov 2012 01:31:55 +0900
> Joonsoo Kim <[email protected]> wrote:
>
> > It is somehow strange that alloc_bootmem return virtual address
> > and free_bootmem require physical address.
> > Anyway, free_bootmem()'s first parameter should be physical address.
> >
> > There are some call sites for free_bootmem() with virtual address.
> > So fix them.
>
> Well gee, I wonder how that happened :(

free_bootmem() is the counterpart to reserve_bootmem() to configure
physical memory ranges. Allocations are assumed to be permanent.

> How does this look?

Much better. How about this in addition?

Signed-off-by: Johannes Weiner <[email protected]>
---

diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 7b74452..b519cb2 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -49,7 +49,7 @@ extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
extern unsigned long free_all_bootmem(void);

extern void free_bootmem_node(pg_data_t *pgdat,
- unsigned long addr,
+ unsigned long physaddr,
unsigned long size);
extern void free_bootmem(unsigned long physaddr, unsigned long size);
extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 4c079ba..5135d84 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -147,7 +147,7 @@ unsigned long __init init_bootmem(unsigned long start, unsigned long pages)

/*
* free_bootmem_late - free bootmem pages directly to page allocator
- * @addr: starting physical address of the range
+ * @physaddr: starting physical address of the range
* @size: size of the range in bytes
*
* This is only useful when the bootmem allocator has already been torn
@@ -385,7 +385,7 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,

/**
* free_bootmem - mark a page range as usable
- * @addr: starting physical address of the range
+ * @physaddr: starting physical address of the range
* @size: size of the range in bytes
*
* Partial pages will be considered reserved and left as they are.
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index 714d5d6..a532960 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -58,21 +58,21 @@ static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align,

/*
* free_bootmem_late - free bootmem pages directly to page allocator
- * @addr: starting address of the range
+ * @physaddr: starting physical address of the range
* @size: size of the range in bytes
*
* This is only useful when the bootmem allocator has already been torn
* down, but we are still initializing the system. Pages are given directly
* to the page allocator, no bootmem metadata is updated because it is gone.
*/
-void __init free_bootmem_late(unsigned long addr, unsigned long size)
+void __init free_bootmem_late(unsigned long physaddr, unsigned long size)
{
unsigned long cursor, end;

- kmemleak_free_part(__va(addr), size);
+ kmemleak_free_part(__va(physaddr), size);

- cursor = PFN_UP(addr);
- end = PFN_DOWN(addr + size);
+ cursor = PFN_UP(physaddr);
+ end = PFN_DOWN(physaddr + size);

for (; cursor < end; cursor++) {
__free_pages_bootmem(pfn_to_page(cursor), 0);
@@ -188,17 +188,17 @@ void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,

/**
* free_bootmem - mark a page range as usable
- * @addr: starting address of the range
+ * @physaddr: starting physical address of the range
* @size: size of the range in bytes
*
* Partial pages will be considered reserved and left as they are.
*
* The range must be contiguous but may span node boundaries.
*/
-void __init free_bootmem(unsigned long addr, unsigned long size)
+void __init free_bootmem(unsigned long physaddr, unsigned long size)
{
- kmemleak_free_part(__va(addr), size);
- memblock_free(addr, size);
+ kmemleak_free_part(__va(physaddr), size);
+ memblock_free(physaddr, size);
}

static void * __init ___alloc_bootmem_nopanic(unsigned long size,