From patchwork Tue Jan 29 10:38:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 14331 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E6DDE23EAD for ; Tue, 29 Jan 2013 10:39:19 +0000 (UTC) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by fiordland.canonical.com (Postfix) with ESMTP id 9490EA184CF for ; Tue, 29 Jan 2013 10:39:19 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so163394vba.13 for ; Tue, 29 Jan 2013 02:39:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=PbmpKtIEecHu3HOqb+7tOfjKIv8NiPaHZyQHwKfFgHk=; b=RDbjQe79/1cI5xqM0/ZUmC+0KRW5Qg4rQgXH63x2jT3fkyis3vENt/qb2ILUzdS/AQ +btnOaPuiF5SOTL0R15UA1vg7nsPoaiVnzIcu+WFGPkSvsc29iCFxTm/ivvoqGnOrgEk Ip/effrUr3LuTllv1UW/4wo5WEH7A5RwFbK2VMsQ0ntspvWrsLLYwgrzQpjAm4oWZYEU NF14M9A9xXXIncPjN7DC8eQp9Z55bmlNYgMFyUVjS0ItPpSZSe099vMhFwaxg6rNfSNe e29bAkc4fiojWczzWhXJKZvFYxnDR6YMNFKAkrtcDru9HdwuMNl2+3sEc7uvmQRjK50C JVaw== X-Received: by 10.220.154.199 with SMTP id p7mr405909vcw.48.1359455959059; Tue, 29 Jan 2013 02:39:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp129104veb; Tue, 29 Jan 2013 02:39:18 -0800 (PST) X-Received: by 10.194.108.229 with SMTP id hn5mr1451529wjb.8.1359455957661; Tue, 29 Jan 2013 02:39:17 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by mx.google.com with ESMTPS id m17si589542wiw.103.2013.01.29.02.39.17 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 02:39:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.212.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.181 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) smtp.mail=vincent.guittot@linaro.org Received: by mail-wi0-f181.google.com with SMTP id c10so242409wiw.8 for ; Tue, 29 Jan 2013 02:39:17 -0800 (PST) X-Received: by 10.180.84.168 with SMTP id a8mr1376646wiz.24.1359455956346; Tue, 29 Jan 2013 02:39:16 -0800 (PST) Received: from localhost.localdomain (LPuteaux-156-14-44-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPS id s8sm2446440wif.9.2013.01.29.02.39.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Jan 2013 02:39:15 -0800 (PST) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, peterz@infradead.org, mingo@kernel.org, fweisbec@gmail.com Cc: Vincent Guittot Subject: [PATCH v2 1/2] sched: fix init NOHZ_IDLE flag Date: Tue, 29 Jan 2013 11:38:59 +0100 Message-Id: <1359455940-1710-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359455940-1710-1-git-send-email-vincent.guittot@linaro.org> References: <1359455940-1710-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQkHjaCFxKwupFZ7VC/ovxE/c0iEmWn9R9CKauDR5ohLuHvqhiDVHNRPnX9Gd+yBFslcUx3c On my smp platform which is made of 5 cores in 2 clusters,I have the nr_busy_cpu field of sched_group_power struct that is not null when the platform is fully idle. The root cause seems to be: During the boot sequence, some CPUs reach the idle loop and set their NOHZ_IDLE flag while waiting for others CPUs to boot. But the nr_busy_cpus field is initialized later with the assumption that all CPUs are in the busy state whereas some CPUs have already set their NOHZ_IDLE flag. We clear the NOHZ_IDLE flag when nr_busy_cpus is initialized in order to have a coherent configuration. Signed-off-by: Vincent Guittot --- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 257002c..fd41924 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5884,6 +5884,7 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) update_group_power(sd, cpu); atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight); + clear_bit(NOHZ_IDLE, nohz_flags(cpu)); } int __weak arch_sd_sibling_asym_packing(void)