All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geoff Levand <geoffrey.levand@am.sony.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: linuxppc-dev@ozlabs.org, anton@au1.ibm.com,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [RFC] PPC64 Exporting memory information through /proc/iomem
Date: Tue, 02 Oct 2007 13:11:42 -0700	[thread overview]
Message-ID: <4702A5FE.5000308@am.sony.com> (raw)
In-Reply-To: <1191346196.6106.20.camel@dyn9047017100.beaverton.ibm.com>

Hi Badari,

Badari Pulavarty wrote:
> Hi Paul & Ben,
> 
> I am trying to get hotplug memory remove working on ppc64.
> In order to verify a given memory region, if its valid or not -
> current hotplug-memory patches used /proc/iomem. On IA64 and
> x86-64 /proc/iomem shows all memory regions. 
> 
> I am wondering, if its acceptable to do the same on ppc64 also ?
> Otherwise, we need to add arch-specific hooks in hotplug-remove
> code to be able to do this.


It seems the only reasonable place is in /proc/iomem, as the the 
generic memory hotplug routines put it in there, and if you have
a ppc64 system that uses add_memory() you will have mem info in
several places, none of which are complete.  


> Index: linux-2.6.23-rc8/arch/powerpc/mm/numa.c
> ===================================================================
> --- linux-2.6.23-rc8.orig/arch/powerpc/mm/numa.c	2007-10-02 10:16:42.000000000 -0700
> +++ linux-2.6.23-rc8/arch/powerpc/mm/numa.c	2007-10-02 10:17:05.000000000 -0700
> @@ -587,6 +587,22 @@ static void __init *careful_allocation(i
>  	return (void *)ret;
>  }
>  
> +static void add_regions_iomem()
> +{
> +	int i;
> +	struct resource *res;
> +
> +	for (i = 0; i < lmb.memory.cnt; i++) {
> +		res = alloc_bootmem_low(sizeof(struct resource));
> +
> +		res->name = "System RAM";
> +		res->start = lmb.memory.region[i].base;
> +		res->end = res->start + lmb.memory.region[i].size - 1;
> +		res->flags = IORESOURCE_MEM;
> +		request_resource(&iomem_resource, res);
> +	}
> +}
> +

I think this duplication of the code in register_memory_resource()
is a maintenance concern though.  I wonder if it would be better
to somehow hook your stuff into into the existing memory hotplug
routines.


-Geoff

WARNING: multiple messages have this Message-ID (diff)
From: Geoff Levand <geoffrey.levand@am.sony.com>
To: Badari Pulavarty <pbadari@us.ibm.com>
Cc: linuxppc-dev@ozlabs.org, linux-mm <linux-mm@kvack.org>,
	anton@au1.ibm.com,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Subject: Re: [RFC] PPC64 Exporting memory information through /proc/iomem
Date: Tue, 02 Oct 2007 13:11:42 -0700	[thread overview]
Message-ID: <4702A5FE.5000308@am.sony.com> (raw)
In-Reply-To: <1191346196.6106.20.camel@dyn9047017100.beaverton.ibm.com>

Hi Badari,

Badari Pulavarty wrote:
> Hi Paul & Ben,
> 
> I am trying to get hotplug memory remove working on ppc64.
> In order to verify a given memory region, if its valid or not -
> current hotplug-memory patches used /proc/iomem. On IA64 and
> x86-64 /proc/iomem shows all memory regions. 
> 
> I am wondering, if its acceptable to do the same on ppc64 also ?
> Otherwise, we need to add arch-specific hooks in hotplug-remove
> code to be able to do this.


It seems the only reasonable place is in /proc/iomem, as the the 
generic memory hotplug routines put it in there, and if you have
a ppc64 system that uses add_memory() you will have mem info in
several places, none of which are complete.  


> Index: linux-2.6.23-rc8/arch/powerpc/mm/numa.c
> ===================================================================
> --- linux-2.6.23-rc8.orig/arch/powerpc/mm/numa.c	2007-10-02 10:16:42.000000000 -0700
> +++ linux-2.6.23-rc8/arch/powerpc/mm/numa.c	2007-10-02 10:17:05.000000000 -0700
> @@ -587,6 +587,22 @@ static void __init *careful_allocation(i
>  	return (void *)ret;
>  }
>  
> +static void add_regions_iomem()
> +{
> +	int i;
> +	struct resource *res;
> +
> +	for (i = 0; i < lmb.memory.cnt; i++) {
> +		res = alloc_bootmem_low(sizeof(struct resource));
> +
> +		res->name = "System RAM";
> +		res->start = lmb.memory.region[i].base;
> +		res->end = res->start + lmb.memory.region[i].size - 1;
> +		res->flags = IORESOURCE_MEM;
> +		request_resource(&iomem_resource, res);
> +	}
> +}
> +

I think this duplication of the code in register_memory_resource()
is a maintenance concern though.  I wonder if it would be better
to somehow hook your stuff into into the existing memory hotplug
routines.


-Geoff



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-10-02 20:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-02 17:29 [RFC] PPC64 Exporting memory information through /proc/iomem Badari Pulavarty
2007-10-02 17:29 ` Badari Pulavarty
2007-10-02 20:11 ` Geoff Levand [this message]
2007-10-02 20:11   ` Geoff Levand
2007-10-02 20:37   ` Badari Pulavarty
2007-10-02 20:37     ` Badari Pulavarty
2007-10-02 20:50     ` Geoff Levand
2007-10-02 20:50       ` Geoff Levand
2007-10-02 22:56 ` Paul Mackerras
2007-10-02 22:56   ` Paul Mackerras
2007-10-02 23:10   ` Badari Pulavarty
2007-10-02 23:10     ` Badari Pulavarty
2007-10-03  1:19     ` KAMEZAWA Hiroyuki
2007-10-03  1:19       ` KAMEZAWA Hiroyuki
2007-10-03 15:35       ` Badari Pulavarty
2007-10-03 15:35         ` Badari Pulavarty
2007-10-03 16:25         ` KAMEZAWA Hiroyuki
2007-10-03 16:25           ` KAMEZAWA Hiroyuki
2007-10-03 16:40           ` Badari Pulavarty
2007-10-03 16:40             ` Badari Pulavarty
2007-10-30 19:19   ` [RFC] hotplug memory remove - walk_memory_resource for ppc64 Badari Pulavarty
2007-10-30 19:19     ` Badari Pulavarty
2007-10-31  5:28     ` KAMEZAWA Hiroyuki
2007-10-31  5:28       ` KAMEZAWA Hiroyuki
2007-10-31  5:34       ` KAMEZAWA Hiroyuki
2007-10-31  5:34         ` KAMEZAWA Hiroyuki
2007-10-31 16:02         ` Badari Pulavarty
2007-10-31 16:02           ` Badari Pulavarty
2007-10-31 15:46           ` KAMEZAWA Hiroyuki
2007-10-31 15:46             ` KAMEZAWA Hiroyuki
2007-10-31 16:48         ` [PATCH 0/3] hotplug memory remove support for PPC64 Badari Pulavarty
2007-10-31 16:48           ` Badari Pulavarty
2007-10-31 16:10       ` [RFC] hotplug memory remove - walk_memory_resource for ppc64 Badari Pulavarty
2007-10-31 16:10         ` Badari Pulavarty

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=4702A5FE.5000308@am.sony.com \
    --to=geoffrey.levand@am.sony.com \
    --cc=anton@au1.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=pbadari@us.ibm.com \
    /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.