From patchwork Mon Nov 19 16:38:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12942 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 832EA23E13 for ; Mon, 19 Nov 2012 16:38:52 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3272DA182FC for ; Mon, 19 Nov 2012 16:38:52 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1037988iag.11 for ; Mon, 19 Nov 2012 08:38:52 -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=YZGlRuEbKdUMgfAdT44bdpDatS2K88V836105amc21Y=; b=ngIr333WpHhym/ihcL/8SKOwXdWzgeezLwW8cwmWuXiqxPHqBkZQ7rR3y8QPZJFFbR 5QzPlrlbMiAKVgJTMmEc2fb5U3coYldPg1J7IQ6j31MktcJ+J1+pGs3AHRmejsyC2PXm xOkHxZq1ipYyIpGLD3Q+kNtpdfYxKk3mneZmrMFiQ1do5luNI1nfy3YmQC4SBGWIroQO jAfReY/FSaJIQzVadhQ6zq5KxloZPMP/UCg5wMYJzOz+RrAm97Z0IsjKjTQzRP3zTOSu XOPvM8VGmJ2/EZljiJCQUUT7iZvPA0WxRtP00crEqouYDwTPMOSui7Ji5FYfAszDwPP1 Y2QA== Received: by 10.50.173.34 with SMTP id bh2mr7050939igc.70.1353343131977; Mon, 19 Nov 2012 08:38:51 -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 n20csp187350igt; Mon, 19 Nov 2012 08:38:51 -0800 (PST) Received: by 10.216.86.6 with SMTP id v6mr4600017wee.42.1353343130935; Mon, 19 Nov 2012 08:38:50 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by mx.google.com with ESMTPS id u57si2213380wee.47.2012.11.19.08.38.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:50 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.181 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.181; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.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-we0-f181.google.com with SMTP id t11so1345970wey.12 for ; Mon, 19 Nov 2012 08:38:50 -0800 (PST) Received: by 10.216.193.224 with SMTP id k74mr182789wen.6.1353343130441; Mon, 19 Nov 2012 08:38:50 -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.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:49 -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 3/3] sched: fix update NOHZ_IDLE flag Date: Mon, 19 Nov 2012 17:38:07 +0100 Message-Id: <1353343087-18015-4-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: ALoCoQmiNTbTguDeZjvaqIYuu8Bj0GJ8K93x+G7VPV4P00VNWonWusKZhEEu/YRpiHwiC2Uh9XZf The function nohz_kick_needed modifies NOHZ_IDLE flag that is used to update the nr_busy_cpus of the sched_group. When the sched_domain are updated (because of the unplug of a CPUs as an example) a null_domain is attached to CPUs. We have to test likely(!on_null_domain(cpu) first in order to detect such intialization step and to not modify the NOHZ_IDLE flag Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3d0686c..1bf7c87 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5490,7 +5490,7 @@ void trigger_load_balance(struct rq *rq, int cpu) likely(!on_null_domain(cpu))) raise_softirq(SCHED_SOFTIRQ); #ifdef CONFIG_NO_HZ - if (nohz_kick_needed(rq, cpu) && likely(!on_null_domain(cpu))) + if (likely(!on_null_domain(cpu)) && nohz_kick_needed(rq, cpu)) nohz_balancer_kick(cpu); #endif }