From patchwork Mon Nov 19 16:38:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 12940 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 C4D5823E13 for ; Mon, 19 Nov 2012 16:38:50 +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 2D398A182FC for ; Mon, 19 Nov 2012 16:38:50 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1037988iag.11 for ; Mon, 19 Nov 2012 08:38:49 -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=epkZLG0MfrcX7hWAt0G2UZFABSix5eq8ypvxNNDhjiY=; b=Dp41X0++T5vQOvqTaWWF2DBDHmW7bT7uNWNf7tK7k9zWi1oOzLEpBlR1F2tsIWUILd 0zIMEcaP2x67RlsCWKYNUlYMT65WtDXEYFGCPF3YXC5sZ+eC+VY1R5d4409tM+m8NW1V APQT29n7EZpeQE3Z6iKj322X7i4MZvsjkCei97pwvNkyukwoe7U0669Ouzu0KB27/CuZ GdpovRjfYGROo+nKw4hbg2elWGrWAwrKevOiOxzK8wbWQ6TpSbA0fY+MFQ8Msbgjrw1Y y6Rrmr6LtJwVKHw6GMtqtXglQgeaatpnTcuYGm5w3qN5nTW23GAPffd60ZL9dFH1KqYQ toHQ== Received: by 10.43.7.132 with SMTP id oo4mr11453607icb.6.1353343129652; Mon, 19 Nov 2012 08:38:49 -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 n20csp187339igt; Mon, 19 Nov 2012 08:38:49 -0800 (PST) Received: by 10.180.24.4 with SMTP id q4mr9868575wif.19.1353343128190; Mon, 19 Nov 2012 08:38:48 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id x74si5418975weo.86.2012.11.19.08.38.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:48 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=209.85.212.177; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.177 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-f177.google.com with SMTP id c10so110601wiw.12 for ; Mon, 19 Nov 2012 08:38:47 -0800 (PST) Received: by 10.216.197.155 with SMTP id t27mr4663508wen.216.1353343127689; Mon, 19 Nov 2012 08:38:47 -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.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Nov 2012 08:38:46 -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 1/3] sched: fix nr_busy_cpus with coupled cpuidle Date: Mon, 19 Nov 2012 17:38:05 +0100 Message-Id: <1353343087-18015-2-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: ALoCoQl6Y2Dp4mr0xhuvnK85tJmvt2N9OsIVv5LMKB1itrPkzDNqpNXhSAddRxxZr0ScftqQd37L With the coupled cpuidle driver (but probably also with other drivers), a CPU loops in a temporary safe state while waiting for other CPUs of its cluster to be ready to enter the coupled C-state. If an IRQ or a softirq occurs, the CPU will stay in this internal loop if there is no need to resched. The SCHED softirq clears the NOHZ and increases nr_busy_cpus. If there is no need to resched, we will not call set_cpu_sd_state_idle because of this internal loop in a cpuidle state. We have to call set_cpu_sd_state_idle in tick_nohz_irq_exit which is used to handle such situation. Signed-off-by: Vincent Guittot --- kernel/time/tick-sched.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a402608..e19bbc9 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -526,6 +526,8 @@ void tick_nohz_irq_exit(void) if (!ts->inidle) return; + set_cpu_sd_state_idle(); + __tick_nohz_idle_enter(ts); }