mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Christoph Lameter <clameter@sgi.com>,
	Dave Hansen <dave@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2 of 4] hotplug-memory: adding non-section-aligned memory is bad
Date: Fri, 28 Mar 2008 10:34:51 +0900	[thread overview]
Message-ID: <20080328102342.B0BF.E1E9C6FF@jp.fujitsu.com> (raw)
In-Reply-To: <20080328102719.3ab9162b.kamezawa.hiroyu@jp.fujitsu.com>

> On Thu, 27 Mar 2008 17:28:38 -0700
> Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
> > --- a/include/linux/mmzone.h
> > +++ b/include/linux/mmzone.h
> > @@ -784,6 +784,9 @@
> >  #define PAGES_PER_SECTION       (1UL << PFN_SECTION_SHIFT)
> >  #define PAGE_SECTION_MASK	(~(PAGES_PER_SECTION-1))
> >  
> > +#define SECTION_SIZE		(1UL << SECTION_SIZE_BITS)
> > +#define SECTION_SIZE_MASK	(SECTION_SIZE - 1)
> > +
> >  #define SECTION_BLOCKFLAGS_BITS \
> >  	((1UL << (PFN_SECTION_SHIFT - pageblock_order)) * NR_PAGEBLOCK_BITS)
> >  
> > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -300,6 +300,11 @@
> >  	int ret;
> >  	u64 start = res->start;
> >  	u64 size = res->end - res->start + 1;
> > +
> > +	/* Adding non-section-aligned memory will give unexpected
> > +	   and unintuitive results. */
> > +	WARN_ON((start & SECTION_SIZE_MASK) != 0);
> > +	WARN_ON((size & SECTION_SIZE_MASK) != 0);
> >  
> Why just WARNING ? not BUG_ON?

Both Nack.

Because, firmware may occupy some area in the section.
Firmware must exclude those area to notify kernel. So, E820, EFI,
or _CRS of ACPI may return not aligned address and size.
register_memory_resource() and walk_memory_resource() are to skip
them silently. This is intended.

Bye.

-- 
Yasunori Goto 



  reply	other threads:[~2008-03-28  1:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28  0:28 [PATCH 0 of 4] [RFC] hotplug memory: minor updates Jeremy Fitzhardinge
2008-03-28  0:28 ` [PATCH 1 of 4] hotplug-memory: add add_memory_resource Jeremy Fitzhardinge
2008-03-28  0:28 ` [PATCH 2 of 4] hotplug-memory: adding non-section-aligned memory is bad Jeremy Fitzhardinge
2008-03-28  1:27   ` KAMEZAWA Hiroyuki
2008-03-28  1:34     ` Yasunori Goto [this message]
2008-03-28  1:54       ` KAMEZAWA Hiroyuki
2008-03-28  2:13         ` Jeremy Fitzhardinge
2008-03-28  2:33           ` KAMEZAWA Hiroyuki
2008-03-28  2:51             ` Jeremy Fitzhardinge
2008-03-28  3:17               ` KAMEZAWA Hiroyuki
2008-03-28  4:20                 ` Jeremy Fitzhardinge
2008-03-28  4:39                   ` KAMEZAWA Hiroyuki
2008-03-28 18:19                     ` Jeremy Fitzhardinge
2008-03-28 18:27                       ` Dave Hansen
2008-03-28  3:21               ` Yasunori Goto
2008-03-28  4:07                 ` Jeremy Fitzhardinge
2008-03-28 21:30             ` Jeremy Fitzhardinge
2008-03-28  0:28 ` [PATCH 3 of 4] sparsemem: reduce i386 PAE section size Jeremy Fitzhardinge
2008-03-28  0:35   ` Christoph Lameter
2008-03-28  2:26     ` Jeremy Fitzhardinge
2008-03-28  2:27       ` Christoph Lameter
2008-03-28  6:18         ` Jeremy Fitzhardinge
2008-03-28 16:43           ` Dave Hansen
2008-03-28 18:05             ` Jeremy Fitzhardinge
2008-03-28 16:45   ` Dave Hansen
2008-03-28  0:28 ` [PATCH 4 of 4] paravirt_ops: don't steal memory resources in paravirt_disable_iospace Jeremy Fitzhardinge
2008-03-28  2:41   ` Rusty Russell
2008-03-28  9:12 ` [PATCH 0 of 4] [RFC] hotplug memory: minor updates Ingo Molnar
2008-03-28 16:07   ` Jeremy Fitzhardinge
2008-03-28 22:04     ` Ingo Molnar

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=20080328102342.B0BF.E1E9C6FF@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=jeremy@goop.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    /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

all inboxes | Powered by JetHome®