From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ingo Molnar Subject: Re: linux-next: Tree for June 5 Date: Fri, 6 Jun 2008 16:57:17 +0200 Message-ID: <20080606145717.GA5300@elte.hu> References: <20080606002957.6329a0ec.akpm@linux-foundation.org> <20080606024811.70db9ab2.akpm@linux-foundation.org> <20080606035413.37f340ef.akpm@linux-foundation.org> <20080606115759.GA29321@elte.hu> <19f34abd0806060533x6d3ff66tc29306143103fc40@mail.gmail.com> <48493CBD.1000202@sgi.com> <19f34abd0806060650q203bef48rd3b20c0cabec4774@mail.gmail.com> <19f34abd0806060707x7570c835u4b1837b54dfa36ba@mail.gmail.com> <484947A9.5050804@sgi.com> <19f34abd0806060736m10424455kfbc3e6272d18646e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:59413 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756127AbYFFO5h (ORCPT ); Fri, 6 Jun 2008 10:57:37 -0400 Content-Disposition: inline In-Reply-To: <19f34abd0806060736m10424455kfbc3e6272d18646e@mail.gmail.com> Sender: linux-next-owner@vger.kernel.org List-ID: To: Vegard Nossum Cc: Mike Travis , Andrew Morton , Stephen Rothwell , linux-next@vger.kernel.org, LKML * Vegard Nossum wrote: > > Thanks, yes I had that some after thought. It should check the node > > index if CONFIG_DEBUG_PER_CPU_MAPS is enabled. One gotcha is that > > nr_node_ids is intialized to MAX_NUMNODES until > > setup_node_to_cpumask_map() sets it to the correct value. So uses > > before that should be caught by the earlier check. > > I think it should always check the node index. The code in > kernel/sched.c (see above) calls node_to_cpumask(i) on nodes 0 < i < > MAX_NUMNODES and it WILL use invalid pointers. Or should > kernel/sched.c be changed to use nr_node_ids instead of MAX_NUMNODES? > I believe there are more places that do this than just sched.c. > > I have attached two patches. The sched one fixes Andrew's boot > problem. The x86 one is untested, but I believe it is better to BUG > than silently corrupt some arbitrary memory. (Then the callers can be > found easily and fixed at least.) nice fixes! I have applied both of them to -tip, this one to tip/sched-devel: > Subject: [PATCH] sched: don't call node_to_cpumask() on nodes > nr_node_ids AFAICS this is not yet required for v2.6.26, as the requirement to never iterate to MAX_NUMNODES and call nr_cpus_node() with the index only got introduced by Mike's patch. and this one to tip/x86/numa: > Subject: [PATCH] x86: don't return invalid pointers from node_to_cpumask() and i've undone the revert of "x86: remove the static 256k node_to_cpumask_map" as well. agreed? Ingo