From: Johannes Weiner <hannes@cmpxchg.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, bugzilla-daemon@bugzilla.kernel.org,
bugme-daemon@bugzilla.kernel.org, qcui@redhat.com,
Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>,
Li Zefan <lizf@cn.fujitsu.com>, Mel Gorman <mgorman@suse.de>
Subject: Re: [Bugme-new] [Bug 36192] New: Kernel panic when boot the 2.6.39+ kernel based off of 2.6.32 kernel
Date: Tue, 7 Jun 2011 12:26:11 +0200 [thread overview]
Message-ID: <20110607102611.GA26954@cmpxchg.org> (raw)
In-Reply-To: <20110607165537.dc9e8888.kamezawa.hiroyu@jp.fujitsu.com>
On Tue, Jun 07, 2011 at 04:55:37PM +0900, KAMEZAWA Hiroyuki wrote:
> On Tue, 7 Jun 2011 09:51:31 +0200
> Johannes Weiner <hannes@cmpxchg.org> wrote:
> > @@ -283,23 +285,30 @@ static int __meminit page_cgroup_callback(struct notifier_block *self,
> >
> > void __init page_cgroup_init(void)
> > {
> > - unsigned long pfn;
> > - int fail = 0;
> > + pg_data_t *pgdat;
> >
> > if (mem_cgroup_disabled())
> > return;
> >
> > - for (pfn = 0; !fail && pfn < max_pfn; pfn += PAGES_PER_SECTION) {
> > - if (!pfn_present(pfn))
> > - continue;
> > - fail = init_section_page_cgroup(pfn);
> > - }
> > - if (fail) {
> > - printk(KERN_CRIT "try 'cgroup_disable=memory' boot option\n");
> > - panic("Out of memory");
> > - } else {
> > - hotplug_memory_notifier(page_cgroup_callback, 0);
> > + for_each_online_pgdat(pgdat) {
> > + unsigned long start;
> > + unsigned long end;
> > + unsigned long pfn;
> > +
> > + start = pgdat->node_start_pfn & ~(PAGES_PER_SECTION - 1);
> > + end = ALIGN(pgdat->node_start_pfn + pgdat->node_spanned_pages,
> > + PAGES_PER_SECTION);
> > + for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) {
> > + if (!pfn_present(pfn))
> > + continue;
> > + if (!init_section_page_cgroup(pgdat->node_id, pfn))
> > + continue;
>
> AFAIK, nodes can overlap. So, this [start, end) scan doesn't work. sections
> may be initizalised mulitple times ...in wrong way. At here, what we can trust
> is nid in page->flags or early_node_map[]?.
Sections are not be initialized multiple times. Once their
page_cgroup array is allocated they are skipped if considered again
later.
Second, even if there are two nodes backing the memory of a single
section, there is still just a single page_cgroup array per section,
we have to take the memory from one node or the other.
So if both node N1 and N2 fall into section SN, SN->page_cgroup will
be an array of page_cgroup structures, allocated on N1, to represent
the pages of SN.
The first section considered when walking the PFNs of N2 will be SN,
which will be skipped because of !!SN->page_cgroup.
I do not see the problem.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2011-06-07 10:26 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-36192-10286@https.bugzilla.kernel.org/>
2011-05-30 6:19 ` [Bugme-new] [Bug 36192] New: Kernel panic when boot the 2.6.39+ kernel based off of 2.6.32 kernel Andrew Morton
2011-05-30 7:01 ` KAMEZAWA Hiroyuki
2011-05-30 7:12 ` Minchan Kim
2011-05-30 7:29 ` KAMEZAWA Hiroyuki
2011-05-30 7:54 ` KAMEZAWA Hiroyuki
2011-05-30 8:51 ` KAMEZAWA Hiroyuki
2011-06-06 12:54 ` Johannes Weiner
2011-06-06 21:45 ` Andrew Morton
2011-06-06 23:45 ` KAMEZAWA Hiroyuki
2011-06-07 8:45 ` Mel Gorman
2011-06-07 8:43 ` KAMEZAWA Hiroyuki
2011-06-07 9:09 ` Mel Gorman
2011-06-07 9:33 ` KAMEZAWA Hiroyuki
2011-06-07 10:18 ` Mel Gorman
2011-06-07 23:40 ` KAMEZAWA Hiroyuki
2011-06-08 0:42 ` KAMEZAWA Hiroyuki
2011-06-08 7:43 ` Mel Gorman
2011-06-08 8:45 ` KAMEZAWA Hiroyuki
2011-06-08 9:03 ` Mel Gorman
2011-06-08 10:15 ` Johannes Weiner
2011-06-09 1:04 ` KAMEZAWA Hiroyuki
2011-06-09 1:42 ` [PATCH] [BUGFIX] Avoid getting nid from invalid struct page at page_cgroup allocation (as " KAMEZAWA Hiroyuki
2011-06-07 0:57 ` KAMEZAWA Hiroyuki
2011-06-07 7:51 ` Johannes Weiner
2011-06-07 7:55 ` KAMEZAWA Hiroyuki
2011-06-07 10:26 ` Johannes Weiner [this message]
2011-06-07 23:45 ` KAMEZAWA Hiroyuki
2011-06-08 9:33 ` Johannes Weiner
2011-06-07 9:03 ` Mel Gorman
2011-06-07 9:06 ` KAMEZAWA Hiroyuki
2011-06-07 10:13 ` Mel Gorman
2011-06-07 8:37 ` Mel Gorman
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=20110607102611.GA26954@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=akpm@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=bugzilla-daemon@bugzilla.kernel.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=lizf@cn.fujitsu.com \
--cc=mgorman@suse.de \
--cc=nishimura@mxp.nes.nec.co.jp \
--cc=qcui@redhat.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;
as well as URLs for NNTP newsgroup(s).