public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: keith mannthey <kmannth@us.ibm.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@osdl.org>,
	"y-goto@jp.fujitsu.com" <y-goto@jp.fujitsu.com>,
	lkml <linux-kernel@vger.kernel.org>,
	lhms-devel <lhms-devel@lists.sourceforge.net>
Subject: Re: [Lhms-devel] [PATCH] memory hotadd fixes [4/5] avoid check in acpi
Date: Thu, 03 Aug 2006 16:09:36 -0700	[thread overview]
Message-ID: <1154646577.5925.30.camel@keithlap> (raw)
In-Reply-To: <1154629724.5925.20.camel@keithlap>

On Thu, 2006-08-03 at 11:28 -0700, keith mannthey wrote:
> On Thu, 2006-08-03 at 12:36 +0900, KAMEZAWA Hiroyuki wrote:
> > add_memory() does all necessary check to avoid collision.
> > then, acpi layer doesn't have to check region by itself.
> > 
> > (*) pfn_valid() just returns page struct is valid or not. It returns 0
> >     if a section has been already added even is ioresource is not added.
> >     ioresource collision check in mm/memory_hotplug.c can do more precise
> >     collistion check.
> >     added enabled bit check just for sanity check..
> > 
> > Signed-Off-By: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> > 
> > 
> >  drivers/acpi/acpi_memhotplug.c |    9 +--------
> >  1 files changed, 1 insertion(+), 8 deletions(-)
> > 
> > Index: linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c
> > ===================================================================
> > --- linux-2.6.18-rc3.orig/drivers/acpi/acpi_memhotplug.c	2006-08-01 16:11:47.000000000 +0900
> > +++ linux-2.6.18-rc3/drivers/acpi/acpi_memhotplug.c	2006-08-02 14:12:45.000000000 +0900
> > @@ -230,17 +230,10 @@
> >  	 * (i.e. memory-hot-remove function)
> >  	 */
> >  	list_for_each_entry(info, &mem_device->res_list, list) {
> > -		u64 start_pfn, end_pfn;
> > -
> > -		start_pfn = info->start_addr >> PAGE_SHIFT;
> > -		end_pfn = (info->start_addr + info->length - 1) >> PAGE_SHIFT;
> > -
> > -		if (pfn_valid(start_pfn) || pfn_valid(end_pfn)) {
> > -			/* already enabled. try next area */
> > +		if (info->enabled) { /* just sanity check...*/
> >  			num_enabled++;
> >  			continue;
> >  		}
> 
> This check needs to go.  pfn_valid is a sparsemem specific check. Sanity
> checking should be done it the the add_memory code. 
> 
> I will test and let you know. This is going to expose some baddness I
> see already with my RESERVE path work. (Extra add_memory calls from this
> driver during boot....)

Ok.  This pfn_valid check needs to be inserted somewhere in the code
path for sparsemem hotadd.

with a debug statement in add_memory

Hotplug Mem Device
add_memory 0 400000000 70000000
System RAM resource 400000000 - 46fffffff cannot be added
add_memory 0 380000000 80000000
System RAM resource 380000000 - 3ffffffff cannot be added
add_memory 0 300000000 80000000
System RAM resource 300000000 - 37fffffff cannot be added
add_memory 0 280000000 80000000
System RAM resource 280000000 - 2ffffffff cannot be added
add_memory 0 200000000 80000000
System RAM resource 200000000 - 27fffffff cannot be added
add_memory 0 180000000 80000000
System RAM resource 180000000 - 1ffffffff cannot be added
add_memory 0 100000000 80000000
System RAM resource 100000000 - 17fffffff cannot be added
add_memory 0 100000 7ff00000

The box doesn't boot.   I am going to drop this patch and see about the
rest of the set.  (They seem sane and look ok but I want to test)

 The kernel needs to protect against bad calls to add_memory (and/or the
acpi driver needs to correctly id devices?)


keith mannthey <kmannth@us.ibm.com>
Linux Technology Center IBM


  reply	other threads:[~2006-08-03 23:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03  3:36 [PATCH] memory hotadd fixes [4/5] avoid check in acpi KAMEZAWA Hiroyuki
2006-08-03 18:28 ` keith mannthey
2006-08-03 23:09   ` keith mannthey [this message]
2006-08-04  0:22     ` [Lhms-devel] " KAMEZAWA Hiroyuki
2006-08-04  0:13 ` keith mannthey
2006-08-04  0:44   ` KAMEZAWA Hiroyuki
2006-08-04  1:54     ` keith mannthey
2006-08-04  2:15       ` KAMEZAWA Hiroyuki
2006-08-04  2:32         ` [PATCH] memory hotadd fixes [6/5] enhance collistion check KAMEZAWA Hiroyuki
2006-08-04  3:09           ` keith mannthey
2006-08-04  3:19             ` KAMEZAWA Hiroyuki
2006-08-04 21:01           ` keith mannthey
2006-08-04  3:00         ` [PATCH] memory hotadd fixes [4/5] avoid check in acpi keith mannthey
2006-08-04  3:13           ` KAMEZAWA Hiroyuki
2006-08-04  3:23             ` keith mannthey
2006-08-04  3:48               ` KAMEZAWA Hiroyuki
2006-08-04  4:25                 ` keith mannthey
2006-08-04  4:32                   ` KAMEZAWA Hiroyuki
2006-08-04  8:23                   ` Mika Penttilä
2006-08-04  8:32                     ` keith mannthey
2006-08-04  5:46                 ` Yasunori Goto
2006-08-04  5:59                   ` [Lhms-devel] " KAMEZAWA Hiroyuki

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=1154646577.5925.30.camel@keithlap \
    --to=kmannth@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=lhms-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=y-goto@jp.fujitsu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox