From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Miller <davem@davemloft.net>,
Linus Torvalds <torvalds@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH 02/16] bootmem, x86: Add weak version of reserve_bootmem_generic
Date: Wed, 28 Jul 2010 14:51:56 +1000 [thread overview]
Message-ID: <1280292716.1970.225.camel@pasglop> (raw)
In-Reply-To: <1279824241-17582-3-git-send-email-yinghai@kernel.org>
On Thu, 2010-07-22 at 11:43 -0700, Yinghai Lu wrote:
> It will be used memblock_x86_to_bootmem converting
The above doesn't make much sense.
Appart from that, no objection.
Ben.
> It is an wrapper for reserve_bootmem, and x86 64bit is using special one.
>
> Also clean up that version for x86_64. We don't need to take care of numa
> path for that, bootmem can handle it how
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---
> arch/x86/mm/init_32.c | 6 ------
> arch/x86/mm/init_64.c | 20 ++------------------
> mm/bootmem.c | 6 ++++++
> 3 files changed, 8 insertions(+), 24 deletions(-)
>
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index bca7909..90e0545 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -1069,9 +1069,3 @@ void mark_rodata_ro(void)
> #endif
> }
> #endif
> -
> -int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
> - int flags)
> -{
> - return reserve_bootmem(phys, len, flags);
> -}
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index ee41bba..634fa08 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -799,13 +799,10 @@ void mark_rodata_ro(void)
>
> #endif
>
> +#ifndef CONFIG_NO_BOOTMEM
> int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
> int flags)
> {
> -#ifdef CONFIG_NUMA
> - int nid, next_nid;
> - int ret;
> -#endif
> unsigned long pfn = phys >> PAGE_SHIFT;
>
> if (pfn >= max_pfn) {
> @@ -821,21 +818,7 @@ int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
> return -EFAULT;
> }
>
> - /* Should check here against the e820 map to avoid double free */
> -#ifdef CONFIG_NUMA
> - nid = phys_to_nid(phys);
> - next_nid = phys_to_nid(phys + len - 1);
> - if (nid == next_nid)
> - ret = reserve_bootmem_node(NODE_DATA(nid), phys, len, flags);
> - else
> - ret = reserve_bootmem(phys, len, flags);
> -
> - if (ret != 0)
> - return ret;
> -
> -#else
> reserve_bootmem(phys, len, flags);
> -#endif
>
> if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) {
> dma_reserve += len / PAGE_SIZE;
> @@ -844,6 +827,7 @@ int __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
>
> return 0;
> }
> +#endif
>
> int kern_addr_valid(unsigned long addr)
> {
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index 142c84a..bde170d 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -526,6 +526,12 @@ int __init reserve_bootmem(unsigned long addr, unsigned long size,
> }
>
> #ifndef CONFIG_NO_BOOTMEM
> +int __weak __init reserve_bootmem_generic(unsigned long phys, unsigned long len,
> + int flags)
> +{
> + return reserve_bootmem(phys, len, flags);
> +}
> +
> static unsigned long __init align_idx(struct bootmem_data *bdata,
> unsigned long idx, unsigned long step)
> {
next prev parent reply other threads:[~2010-07-28 4:52 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-22 18:43 [PATCH -v26 00/16] Use memblock with x86 Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 01/16] x86, memblock: Add memblock_x86_find_in_range_size() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-28 4:49 ` Benjamin Herrenschmidt
2010-07-22 18:43 ` [PATCH 02/16] bootmem, x86: Add weak version of reserve_bootmem_generic Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-28 4:51 ` Benjamin Herrenschmidt [this message]
2010-07-22 18:43 ` [PATCH 03/16] x86, memblock: Add memblock_x86_to_bootmem() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-28 5:00 ` Benjamin Herrenschmidt
2010-07-28 5:40 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 04/16] x86,memblock: Add memblock_x86_reserve_range/memblock_x86_free_range Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 05/16] x86, memblock: Add get_free_all_memory_range() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-28 5:02 ` Benjamin Herrenschmidt
2010-07-28 5:41 ` Yinghai Lu
2010-07-28 19:15 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 06/16] x86, memblock: Add memblock_x86_register_active_regions() and memblock_x86_hole_size() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 07/16] memblock: Add find_memory_core_early() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 08/16] x86, memblock: Add memblock_x86_find_in_range_node() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 09/16] x86, memblock: Add memblock_x86_free_memory_in_range() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 10/16] x86, memblock: Add memblock_x86_memory_in_range() Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 11/16] x86, memblock: Use memblock_debug to control debug message print out Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 12/16] x86: Use memblock to replace early_res Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 13/16] x86: Replace e820_/_early string with memblock_ Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:43 ` [PATCH 14/16] x86: Remove not used early_res code Yinghai Lu
2010-07-22 18:43 ` Yinghai Lu
2010-07-22 18:44 ` [PATCH 15/16] x86, memblock: Use memblock_memory_size()/memblock_free_memory_size() to get correct dma_reserve Yinghai Lu
2010-07-22 18:44 ` Yinghai Lu
2010-07-22 18:44 ` [PATCH 16/16] x86: remove old bootmem code Yinghai Lu
2010-07-22 18:44 ` Yinghai Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1280292716.1970.225.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hannes@cmpxchg.org \
--cc=hpa@zytor.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.