From patchwork Mon Dec 3 12:26:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 13331 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 BF47423E2A for ; Mon, 3 Dec 2012 12:27:03 +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 73597A194B0 for ; Mon, 3 Dec 2012 12:27:03 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so3822720ieb.11 for ; Mon, 03 Dec 2012 04:27:02 -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=p1yEVRg7BbksuoimntNSYSyYPlWc5DpRnBmPVX2vs1Q=; b=folvaHcrzhXm6lNjVmUMiKik1BOnT0lFFsYzRxoQmj5ks9XO32uKbflsSYO14CAdGQ 5DCVXUTLxU0SMC5qBn1k/NCIhr88GR7phYfiM3TIobGkqn8yvbJ9fB4T5twWsj8O1xvh UhTODsr398xbtya7MuhgmTdPRDxyxPBYl4dkRdPU1fxTjhfcdge4p4wiRhR+nTa5xOBU AiHTIYn59YOuo+jqAIr2KEob47T1updMEKFL/nHrbjKENDTfaYb48mWsSIAyW9B0OHIv W+KpSvdXXGkrL5zih3NTt/WyxoyuZA475MxmsSUjG3PU465nYOVr3d02lsW5zbfpHmoZ FJyQ== Received: by 10.43.125.133 with SMTP id gs5mr7630581icc.54.1354537622774; Mon, 03 Dec 2012 04:27:02 -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 n20csp133563igt; Mon, 3 Dec 2012 04:27:01 -0800 (PST) Received: by 10.180.19.73 with SMTP id c9mr9237708wie.8.1354537621413; Mon, 03 Dec 2012 04:27:01 -0800 (PST) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by mx.google.com with ESMTPS id g18si8137272wiw.13.2012.12.03.04.27.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Dec 2012 04:27:01 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.46 is neither permitted nor denied by best guess record for domain of vincent.guittot@linaro.org) client-ip=74.125.82.46; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.46 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-f46.google.com with SMTP id dr13so1579926wgb.1 for ; Mon, 03 Dec 2012 04:27:01 -0800 (PST) Received: by 10.216.207.144 with SMTP id n16mr718346weo.113.1354537620814; Mon, 03 Dec 2012 04:27:00 -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 w5sm12317990wiz.10.2012.12.03.04.26.59 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 03 Dec 2012 04:27:00 -0800 (PST) From: Vincent Guittot To: linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, peterz@infradead.org, mingo@kernel.org Cc: ccross@android.com, Vincent Guittot Subject: [PATCH Resend 1/3] sched: fix nr_busy_cpus with coupled cpuidle Date: Mon, 3 Dec 2012 13:26:26 +0100 Message-Id: <1354537588-25831-2-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1354537588-25831-1-git-send-email-vincent.guittot@linaro.org> References: <1354537588-25831-1-git-send-email-vincent.guittot@linaro.org> X-Gm-Message-State: ALoCoQmOTLvGG5n+RsBtTb5H0WSo21Ler0A6Jknv6MHjCnYNPGrjihVZPgZAN77zR/veLPH5HkJq 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 955d35b..b8d74ea 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -570,6 +570,8 @@ void tick_nohz_irq_exit(void) if (!ts->inidle) return; + set_cpu_sd_state_idle(); + /* Cancel the timer because CPU already waken up from the C-states*/ menu_hrtimer_cancel(); __tick_nohz_idle_enter(ts);