From: Andrew Morton <akpm@osdl.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: kmannth@us.ibm.com, linux-kernel@vger.kernel.org, clameter@engr.sgi.com
Subject: Re: [BUG] i386 2.6.18 cpu_up: attempt to bring up CPU 4 failed : kernel BUG at mm/slab.c:2698!
Date: Thu, 21 Sep 2006 20:42:42 -0700 [thread overview]
Message-ID: <20060921204242.53a88487.akpm@osdl.org> (raw)
In-Reply-To: <20060922123045.d7258e13.kamezawa.hiroyu@jp.fujitsu.com>
On Fri, 22 Sep 2006 12:30:45 +0900
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Thu, 21 Sep 2006 20:08:06 -0700
> Andrew Morton <akpm@osdl.org> wrote:
>
> > But why did the kmalloc() fail?
> >
> >
> from this:
>
> ==
> #define NOTIFY_DONE 0x0000 /* Don't care */
> #define NOTIFY_OK 0x0001 /* Suits me */
> #define NOTIFY_STOP_MASK 0x8000 /* Don't call further */
> #define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002)
> ==
>
> I gues someone returns NOTIFY_BAD before pageset_cpuup_callback() is called.
> When CPU_UP_CANCELED comes, pageset_cpuup_callback() can't know zone_pcp()
> is kmalloced or not. Is this ugly ?
>
> -Kame
>
> Before kfree(), we should check zone_pcp() is not boot_pageset[].
>
> Signed-Off-By KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
>
> Index: linux-2.6.18/mm/page_alloc.c
> ===================================================================
> --- linux-2.6.18.orig/mm/page_alloc.c 2006-09-20 12:42:06.000000000 +0900
> +++ linux-2.6.18/mm/page_alloc.c 2006-09-22 12:22:03.000000000 +0900
> @@ -1844,9 +1844,11 @@
>
> for_each_zone(zone) {
> struct per_cpu_pageset *pset = zone_pcp(zone, cpu);
> -
> - zone_pcp(zone, cpu) = NULL;
> - kfree(pset);
> + /* When canceled, zone_pcp still points to boot_pageset[] */
> + if (zone_pcp(zone, cpu) != &boot_pageset[cpu]) {
> + zone_pcp(zone, cpu) = NULL;
> + kfree(pset);
> + }
> }
> }
>
No, that's OK as it is now. The above code is numa-only, in which case
zone_pcp(zone, cpu) is known to be kmalloced. These functions won't even
compile on !NUMA because in that case, zone_pcp() isn't an lvalue.
OBCodingStyleNit: could we pleeeeeze not go and use macros as lvalues like
this? It looks just too weird. Simply do zone_pcp(zone, cpu) and
set_zone_pcp(zone, cpu, val).
next prev parent reply other threads:[~2006-09-22 3:43 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-22 0:17 [BUG] i386 2.6.18 cpu_up: attempt to bring up CPU 4 failed : kernel BUG at mm/slab.c:2698! keith mannthey
2006-09-22 0:41 ` Andrew Morton
2006-09-22 1:34 ` keith mannthey
2006-09-22 2:09 ` KAMEZAWA Hiroyuki
2006-09-22 2:24 ` KAMEZAWA Hiroyuki
2006-09-22 3:08 ` Andrew Morton
2006-09-22 3:30 ` KAMEZAWA Hiroyuki
2006-09-22 3:38 ` David Rientjes
2006-09-22 3:42 ` Andrew Morton [this message]
2006-09-22 3:46 ` Andrew Morton
2006-09-22 4:09 ` David Rientjes
2006-09-22 18:20 ` [PATCH] do not free non slab allocated per_cpu_pageset David Rientjes
2006-09-22 18:22 ` Christoph Lameter
2006-09-22 18:39 ` Andrew Morton
2006-09-22 18:43 ` Christoph Lameter
2006-09-22 18:56 ` Andrew Morton
2006-09-22 19:06 ` Christoph Lameter
2006-09-22 19:10 ` David Rientjes
2006-09-22 19:44 ` [BUG] i386 2.6.18 cpu_up: attempt to bring up CPU 4 failed : kernel BUG at mm/slab.c:2698! keith mannthey
2006-09-23 5:19 ` Andrew Morton
2006-09-22 2:31 ` 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=20060921204242.53a88487.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=clameter@engr.sgi.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kmannth@us.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox