From patchwork Tue May 13 09:11:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 30007 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F0AF20369 for ; Tue, 13 May 2014 09:12:23 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id ey11sf266551pad.0 for ; Tue, 13 May 2014 02:12:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=4opHi5CWtV+1SU75gA+4a7/7auGBfS/3TWpEoC27XJw=; b=auLSf3ExcQK45VXH/i/xdcLROTrSxECduWFlGHmY1un3sWS+nJwRvwVYrUBIf76CyQ dk+dCiiqBw+sFN7m7SpgxtBLz4eBlRq9I+HswTLXatcI4Ja61sRCFIwK6APuRO30YqpB CLHbCALroRCOH0lnjU/8cbyq+vyf5Nfdb9gcliLk5zC04XIlNlA42/+BNehJj5VmSZVD xDzhtrJt941Npo7E1szTE6AATjsF5K4WOmt/VsTFgG/T2miz/Tc8+5Z81tq+x20RQXsC 4U58Nrj1btamk+HZcSKFLdImydSgAmml49dAVnVI4uYnIs6M4M9gHmBi/Ieu7B9XO4i1 OGaQ== X-Gm-Message-State: ALoCoQm3BZuEcwDn7YQFhcDI9DbDsGaQYlwO9/uSm6Z6+aCSAFF4k+UlJl4vmZvH/Tfo1lZPk8nd X-Received: by 10.68.202.99 with SMTP id kh3mr1897320pbc.8.1399972342881; Tue, 13 May 2014 02:12:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.18.200 with SMTP id 66ls1803684qgf.24.gmail; Tue, 13 May 2014 02:12:22 -0700 (PDT) X-Received: by 10.58.195.231 with SMTP id ih7mr1088583vec.32.1399972342700; Tue, 13 May 2014 02:12:22 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id s10si2544028vco.56.2014.05.13.02.12.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 02:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id db12so57972veb.39 for ; Tue, 13 May 2014 02:12:22 -0700 (PDT) X-Received: by 10.220.105.4 with SMTP id r4mr7705083vco.27.1399972342586; Tue, 13 May 2014 02:12:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp135195vcb; Tue, 13 May 2014 02:12:22 -0700 (PDT) X-Received: by 10.69.19.225 with SMTP id gx1mr3877194pbd.34.1399972341841; Tue, 13 May 2014 02:12:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ld16si12645938pab.175.2014.05.13.02.12.21; Tue, 13 May 2014 02:12:21 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759900AbaEMJML (ORCPT + 27 others); Tue, 13 May 2014 05:12:11 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:34592 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759884AbaEMJMI (ORCPT ); Tue, 13 May 2014 05:12:08 -0400 Received: by mail-we0-f176.google.com with SMTP id q59so60929wes.7 for ; Tue, 13 May 2014 02:12:07 -0700 (PDT) X-Received: by 10.194.222.197 with SMTP id qo5mr560388wjc.78.1399972327374; Tue, 13 May 2014 02:12:07 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id bx2sm21394706wjb.47.2014.05.13.02.12.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 02:12:05 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org Cc: jet.chen@intel.com, fengguang.wu@intel.com, linux-ia64@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot Subject: sched: fix: initialization of sched_domain_topology for NUMA Date: Tue, 13 May 2014 11:11:01 +0200 Message-Id: <1399972261-25693-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <20140513082609.GA2485@laptop.programming.kicks-ass.net> References: <20140513082609.GA2485@laptop.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vincent.guittot@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Jet Chen has reported a kernel panics when booting qemu-system-x86_64 with kvm64 cpu. A panic occured while building the sched_domain. In sched_init_numa, we create a new topology table in which both default levels and numa levels are copied. The last row of the table must have a null pointer in the mask field. The current implementation doesn't add this last row in the computation of the table size. So we add 1 row in the allocation size that will be used as the last row of the table. The kzalloc will ensure that the mask field is NULL. Reported-by: Jet Chen Tested-by: Jet Chen Signed-off-by: Vincent Guittot link: https://lkml.org/lkml/2014/5/12/130 --- Hi Peter, Does this commit message contain enough information ? Regards, Vincent kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4ea7b3f..205fa17 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6234,7 +6234,7 @@ static void sched_init_numa(void) /* Compute default topology size */ for (i = 0; sched_domain_topology[i].mask; i++); - tl = kzalloc((i + level) * + tl = kzalloc((i + level + 1) * sizeof(struct sched_domain_topology_level), GFP_KERNEL); if (!tl) return;