From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751268AbZKJFPr (ORCPT ); Tue, 10 Nov 2009 00:15:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750841AbZKJFPr (ORCPT ); Tue, 10 Nov 2009 00:15:47 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:38570 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750830AbZKJFPq (ORCPT ); Tue, 10 Nov 2009 00:15:46 -0500 Date: Tue, 10 Nov 2009 06:15:37 +0100 From: Ingo Molnar To: Kenji Kaneshige , stable kernel team Cc: Peter Zijlstra , linux-kernel@vger.kernel.org, Rusty Russell Subject: Re: Kernel oops in resched_task() with 2.6.31.5 Message-ID: <20091110051537.GF7897@elte.hu> References: <4AF80B8B.8080203@jp.fujitsu.com> <1257770720.4108.195.camel@laptop> <4AF810C5.4010505@jp.fujitsu.com> <4AF8F63B.1040402@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AF8F63B.1040402@jp.fujitsu.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.5 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Kenji Kaneshige wrote: > Kenji Kaneshige wrote: > >Peter Zijlstra wrote: > >>On Mon, 2009-11-09 at 21:31 +0900, Kenji Kaneshige wrote: > >>>Hi, > >>> > >>>I frequently encounter the kernel oops attached below in resched_task() > >>>with 2.6.31.5. This kernel oops happens also with 2.6.32-rc5. I don't > >>>know about other kernel. > >>> > >>>Here is my analysis: > >>> > >>>The immediate cause of this kernel oops is that NULL was passed to > >>>resched_task() from resched_cpu(). From my investigation, this was > >>>caused as follows: > >>> > >>>- trigger_load_balance() caluculated cpu number of idle load balancer > >>> using find_new_ilb(), and find_new_ilb() returned *offline* CPU > >>> number (16 in my case). Note that I didn't do any CPU hotplug > >>> operation. On my system, present, online and offline under > >>> /sys/devices/system/cpu/ are > >>> > >>> [kanesige@localhost ~]$ cat /sys/devices/system/cpu/present > >>> 0-15 > >>> [kanesige@localhost ~]$ cat /sys/devices/system/cpu/online > >>> 0-15 > >>> [kanesige@localhost ~]$ cat /sys/devices/system/cpu/offline > >>> 16-255 > >>> > >>> And nr_cpu_ids is 256. > >>> > >>>- resched_cpu() calculated current task by cpu_curr() with offline CPU > >>> number. > >>> > >>>So this kernel oops seems to be caused by invalid CPU number returned > >>>from find_new_ilb(). I don't know the find_new_ilb() implementation, > >>>but I suspect the initialization of cpumasks used by find_new_ilb(). > >>>The patch attached below seems to fix the problem (With this patch, > >>>the kernel oops doesn't happen). But I don't know if this is the > >>>correct fix. > >> > >>Please send patches against -tip. > >> > >>You might find that Rusty has already fixed a similar issue there in > >>commit: 49557e620339cb134127b5bfbcfecc06b77d0232. > >> > >>Now, Rusty's patch does not clear the ilb mask, so maybe it doesn't > >>fully cover your issue, please test. > >> > > > >Thank you for quick response. > > > >I didn't notice Rusty's fix. > >I'll look at and test it tomorrow. > > > > I tested Rusty's patch and confirmed it fixes the problem. Thanks. -stable team, please cherry-pick this upstream commit for .31.x: 49557e6: sched: Fix boot crash by zalloc()ing most of the cpu masks Ingo