From patchwork Mon Nov 19 16:38:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12941 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 428C323E13 for ; Mon, 19 Nov 2012 16:38:51 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 02421A182FC for ; Mon, 19 Nov 2012 16:38:50 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so6741252iej.11 for ; Mon, 19 Nov 2012 08:38:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=7cMpHuj4HOmOKGsrg2A00NOFX0FHdOJ+kZWHFrO235o=; b=EHOe7CPRhd9uG6ocks3AACYo0tvGTXKG+F6mKcTowYr42GMvadQo2fn7SJJKuLwb5X C5yP3WdS8mnm10xn7xILR4GlmmCbLtzGe3eFU0n47CF5+pQHjtg8/cSjpxaloFQLhJ+A RT9js2M1zeno9gShYdBbSJwlOElP0jVVhvOsFU28jN5evuP21lQs4CjpzokX1JnHS7i8 imTAqG+W+otVBuJFH1B4Kv8lwlLYxEX1AZZL/Dgu0r/av6ba5/gB3ILqUc7Y/nDxSDXW /daVi9zc7Lwyf++FiRYQXPcICaUrN+jfDIQoo827UFUAqfqsl0VIgYd0kwsiDoiq/ceS TTKw== Received: by 10.50.187.197 with SMTP id fu5mr7028807igc.70.1353343130780; Mon, 19 Nov 2012 08:38:50 -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.50.67.148 with SMTP id n20csp187346igt; Mon, 19 Nov 2012 08:38:50 -0800 (PST) Received: by 10.180.74.108 with SMTP id s12mr9898744wiv.12.1353343129605; Mon, 19 Nov 2012 08:38:49 -0800 (PST) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by mx.google.com with ESMTPS id fp4si8986513wib.15.2012.11.19.08.38.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:49 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.43 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.43; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.43 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-wg0-f43.google.com with SMTP id dq12so1295194wgb.0 for ; Mon, 19 Nov 2012 08:38:49 -0800 (PST) Received: by 10.216.203.226 with SMTP id f76mr434228weo.45.1353343129082; Mon, 19 Nov 2012 08:38:49 -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 j18sm14036398wiv.9.2012.11.19.08.38.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:48 -0800 (PST) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, peterz@infradead.org, mingo@redhat.com Cc: ccross@android.com, Vincent Guittot Subject: [RFC 2/3] sched: fix init NOHZ_IDLE flag Date: Mon, 19 Nov 2012 17:38:06 +0100 Message-Id: <1353343087-18015-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1353343087-18015-1-git-send-email-vincent.guittot@linaro.org> References: <1353343087-18015-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQmUEdx55VXcHOy6cq9N093bdjiw/5xMT1A2fQfnadHQBHDL0s5S5x7DntQvzCygWsDA1soc 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 5dae0d2..05058e8 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5817,6 +5817,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)