All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Keith Mannthey <kmannth@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, discuss@x86-64.org,
	ak@suse.de, lhms-devel@lists.sourceforge.net,
	kamezawa.hiroyu@jp.fujitsu.com
Subject: Re: [PATCH 4/10] hot-add-mem x86_64: Enable SPARSEMEM in srat.c
Date: Fri, 04 Aug 2006 10:42:32 -0700	[thread overview]
Message-ID: <1154713352.10109.31.camel@localhost.localdomain> (raw)
In-Reply-To: <20060804131409.21401.58904.sendpatchset@localhost.localdomain>

On Fri, 2006-08-04 at 07:14 -0600, Keith Mannthey wrote:
> From: Keith Mannthey <kmannth@us.ibm.com>
> 
>  Enable x86_64 srat.c to share code between both reserve and sparsemem based add memory
> paths.  Both paths need the hot-add area node locality infomration (nodes_add).  This 
> code refactors the code path to allow this. 

I won't respond to all of these, but the set looks pretty darn sane.  

> Signed-off-by: Keith Mannthey<kmannth@us.ibm.com>
> ---
>  srat.c |   51 +++++++++++++++++++++++++++++----------------------
>  1 files changed, 29 insertions(+), 22 deletions(-)
> 
> Files orig/arch/x86_64/mm/.srat.c.swp and current/arch/x86_64/mm/.srat.c.swp differ
> diff -urN orig/arch/x86_64/mm/srat.c current/arch/x86_64/mm/srat.c
> --- orig/arch/x86_64/mm/srat.c	2006-08-04 00:41:17.000000000 -0400
> +++ current/arch/x86_64/mm/srat.c	2006-08-04 01:02:25.000000000 -0400
> @@ -21,12 +21,6 @@
>  #include <asm/numa.h>
>  #include <asm/e820.h>
>  
> -#if (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \
> -	defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) \
> -		&& !defined(CONFIG_MEMORY_HOTPLUG)
> -#define RESERVE_HOTADD 1
> -#endif

Thanks goodness this is going away :)

>  static struct acpi_table_slit *acpi_slit;
>  
>  static nodemask_t nodes_parsed __initdata;
> @@ -34,9 +28,6 @@
>  static struct bootnode nodes_add[MAX_NUMNODES] __initdata;
>  static int found_add_area __initdata;
>  int hotadd_percent __initdata = 0;
> -#ifndef RESERVE_HOTADD
> -#define hotadd_percent 0	/* Ignore all settings */
> -#endif
>  
>  /* Too small nodes confuse the VM badly. Usually they result
>     from BIOS bugs. */
> @@ -157,7 +148,7 @@
>  	       pxm, pa->apic_id, node);
>  }
>  
> -#ifdef RESERVE_HOTADD
> +#ifdef CONFIG_MEMORY_HOTPLUG_RESERVE
>  /*
>   * Protect against too large hotadd areas that would fill up memory.
>   */
> @@ -200,15 +191,37 @@
>  	return 1;
>  }
>  
> +static int update_end_of_memory(unsigned long end)
> +{
> +	found_add_area = 1;
> +	if ((end >> PAGE_SHIFT) > end_pfn)
> +		end_pfn = end >> PAGE_SHIFT;
> +	return 1;
> +}

I don't have a really strong feeling either way, but you can use
include/linux/pfn.h and PFN_DOWN() here, instead of the explicit >>'s.

> +static inline int save_add_info(void)
> +{
> +	return hotadd_percent > 0;
> +}

This name is a wee bit too generic to be in the global namespace.
Perhaps there should be a "memory" in there somewhere.


> -#ifdef RESERVE_HOTADD
> - 	if (ma->flags.hot_pluggable && reserve_hotadd(node, start, end) < 0) {
> + 	if (ma->flags.hot_pluggable && !reserve_hotadd(node, start, end) < 0) {
>  		/* Ignore hotadd region. Undo damage */
>  		printk(KERN_NOTICE "SRAT: Hotplug region ignored\n");
>  		*nd = oldnode;
>  		if ((nd->start | nd->end) == 0)
>  			node_clear(node, nodes_parsed);
>  	}
> -#endif
>  }

Cool.  No more #ifdef.

-- Dave


  parent reply	other threads:[~2006-08-04 17:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 13:13 [PATCH 1/10] hot-add-mem x86_64: acpi motherboard fix Keith Mannthey
2006-08-04 13:13 ` [PATCH 2/10] hot-add-mem x86_64: fixup externs Keith Mannthey
2006-08-04 13:14 ` [PATCH 3/10] hot-add-mem x86_64: Kconfig changes Keith Mannthey
2006-08-04 13:14 ` [PATCH 4/10] hot-add-mem x86_64: Enable SPARSEMEM in srat.c Keith Mannthey
2006-08-04 15:17   ` [Lhms-devel] " Mika Penttilä
2006-08-04 19:36     ` keith mannthey
2006-08-04 17:42   ` Dave Hansen [this message]
2006-08-04 13:14 ` [PATCH 5/10] hot-add-mem x86_64: memory_add_physaddr_to_nid enable Keith Mannthey
2006-08-04 13:14 ` [PATCH 7/10] hot-add-mem x86_64: x86_64 kernel mapping fix Keith Mannthey
2006-08-04 13:14 ` [PATCH 8/10] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_SPARSE Keith Mannthey
2006-08-04 13:14 ` [PATCH 9/10] hot-add-mem x86_64: use CONFIG_MEMORY_HOTPLUG_RESERVE Keith Mannthey
2006-08-07 17:41   ` keith mannthey
2006-08-04 13:14 ` [PATCH 10/10] hot-add-mem x86_64: valid add range check Keith Mannthey
2006-08-05  5:39 ` [PATCH 1/10] hot-add-mem x86_64: acpi motherboard fix KAMEZAWA Hiroyuki
2006-08-05  5:51 ` KAMEZAWA Hiroyuki
2006-08-07 18:39   ` keith mannthey
2006-08-08  0:31     ` [Lhms-devel] " KAMEZAWA Hiroyuki
2006-08-08  0:56       ` keith mannthey
2006-08-08  2:08         ` KAMEZAWA Hiroyuki
2006-08-08  2:15           ` keith mannthey

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=1154713352.10109.31.camel@localhost.localdomain \
    --to=haveblue@us.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=discuss@x86-64.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kmannth@us.ibm.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.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.