From patchwork Fri Feb 8 18:05:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 14703 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 927A923E33 for ; Fri, 8 Feb 2013 18:06:10 +0000 (UTC) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by fiordland.canonical.com (Postfix) with ESMTP id 4BB72A186E9 for ; Fri, 8 Feb 2013 18:06:10 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id cz10so3538182veb.21 for ; Fri, 08 Feb 2013 10:06:09 -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=E4Zd+JhJFDBMTUOo8TLhHvtrF+aJ+hUfCtnAfJtHqVE=; b=DfkKcg7AwSgT6RFWFTum/rwRHEga5DfMnq2j3mH3s7ml8+HW1jQzn+AXRPJtukOMER /MaUNUxCjptnMUOv23EWsUOk0dRsDE0dipe1M6twycq43Y0z03fetse7y3a01E4TyeJ1 oHTWVpzLS53LLZqKPOllO1Ip0W66STqsThJsnrGZQejVgpHzKGi6UBu5iXRf2Y6o0MAO dFdn4nzS7yUDVDJsUt7cNLx2WSOXkl5FEPdT5bmwq2fOvEpUmMaBJe6SXSWyltloUSe0 22SkVHdyTex/gV0JJj43xVZK+YQ+Vd2w5JeTzKUN8KlkuQ0OdZx1frLZj8xOlFuhAjxo eDJQ== X-Received: by 10.220.149.200 with SMTP id u8mr7766174vcv.7.1360346769807; Fri, 08 Feb 2013 10:06:09 -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.252.8 with SMTP id zo8csp160634vec; Fri, 8 Feb 2013 10:06:09 -0800 (PST) X-Received: by 10.194.78.207 with SMTP id d15mr11473343wjx.52.1360346768652; Fri, 08 Feb 2013 10:06:08 -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 ba8si2410799wjc.204.2013.02.08.10.06.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Feb 2013 10:06:08 -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 hm6so1181854wib.2 for ; Fri, 08 Feb 2013 10:06:08 -0800 (PST) X-Received: by 10.180.77.68 with SMTP id q4mr4267975wiw.10.1360346768266; Fri, 08 Feb 2013 10:06:08 -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 s8sm15694093wif.9.2013.02.08.10.06.06 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Feb 2013 10:06:07 -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, rostedt@goodmis.org, efault@gmx.de Cc: Vincent Guittot Subject: [PATCH v3 1/2] sched: fix init NOHZ_IDLE flag Date: Fri, 8 Feb 2013 19:05:17 +0100 Message-Id: <1360346718-3313-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360346718-3313-1-git-send-email-vincent.guittot@linaro.org> References: <1360346718-3313-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQkY9+KjBklZcjuvnNA/w0nb/wTBIFG3LT4gRxiQkg+A5YGVJvYecyCxH2+pEJ90x+dgAD5P 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 set the NOHZ_IDLE flag when nr_busy_cpus is initialized to 0 in order to have a coherent configuration. The patch 2/2 protects this init against an update of NOHZ_IDLE flag because a NULL sched_domain is attached to the CPU during the build of the new sched_domain so nohz_kick_needed and set_cpu_sd_state_busy are not called and can't clear the NOHZ_IDLE flag Signed-off-by: Vincent Guittot --- kernel/sched/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 26058d0..c730a4e 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5884,7 +5884,9 @@ static void init_sched_groups_power(int cpu, struct sched_domain *sd) return; update_group_power(sd, cpu); - atomic_set(&sg->sgp->nr_busy_cpus, sg->group_weight); + atomic_set(&sg->sgp->nr_busy_cpus, 0); + set_bit(NOHZ_IDLE, nohz_flags(cpu)); + } int __weak arch_sd_sibling_asym_packing(void)