From patchwork Fri Apr 4 08:35:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27791 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0616F20490 for ; Fri, 4 Apr 2014 08:37:32 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf7919716qcq.0 for ; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=PLDCGfnsUTNuQJh9QuvEbjgWDyKaP2JRRt3CIW8RU4s=; b=Y1F77AQyDLBQm1EKZNCccA3s3X6ocvHygT9f3LBVDYw/jUB5drKnPbe6lnz0suqcMh SH3GkviJwORFENzE4BNIQbm/KjQB0OPThnHKCUZfAXEtqUuq0avzckeTMAbj9c26f63a AHWHX+z9PQ6mdzB8dDp5Ap66p52CpEnX4GmOtZh1/wCYqRjIPxU876gBWQGgPrM/jgQL 5C8Ov5OJBO3CDlqMkNXt6xvNPyxYY2G9wXvQnE3VfrY1aMXNTza7GsHNJj/00BeM75aO SRYVqzNaygkuDvD54Bjcw2cgWCW27Wq7w12OMJdPEcE+wTvo+5btkRwrbT74qsLOXt4P ZNAg== X-Gm-Message-State: ALoCoQlNovYNMRN0xnELUucjOHUz6Tqh9OJwcV4JV/AQeVwo//XWylbybyt4vrIgzo410L2Jeu4c X-Received: by 10.58.154.228 with SMTP id vr4mr2892689veb.0.1396600652794; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.71 with SMTP id d65ls963505qgf.17.gmail; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr4728485vcb.5.1396600652671; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id rx10si1676957vdc.114.2014.04.04.01.37.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:37:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so1172975veb.6 for ; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) X-Received: by 10.52.78.231 with SMTP id e7mr309550vdx.28.1396600652575; Fri, 04 Apr 2014 01:37:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp95622vcv; Fri, 4 Apr 2014 01:37:31 -0700 (PDT) X-Received: by 10.68.202.230 with SMTP id kl6mr13459339pbc.55.1396600650702; Fri, 04 Apr 2014 01:37:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si900970pax.392.2014.04.04.01.37.29; Fri, 04 Apr 2014 01:37:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752133AbaDDIhV (ORCPT + 27 others); Fri, 4 Apr 2014 04:37:21 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:44423 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752058AbaDDIgx (ORCPT ); Fri, 4 Apr 2014 04:36:53 -0400 Received: by mail-wi0-f179.google.com with SMTP id z2so758175wiv.6 for ; Fri, 04 Apr 2014 01:36:51 -0700 (PDT) X-Received: by 10.180.38.41 with SMTP id d9mr2541106wik.9.1396600611914; Fri, 04 Apr 2014 01:36:51 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id xs1sm11407319wjb.27.2014.04.04.01.36.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:36:51 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de, fweisbec@gmail.com, peterz@infradead.org, mingo@kernel.org, tj@kernel.org, lizefan@huawei.com Cc: linaro-kernel@lists.linaro.org, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 8/8] sched: don't queue timers on quiesced CPUs Date: Fri, 4 Apr 2014 14:05:35 +0530 Message-Id: <3fefafdf2d06b1d6ecc0e2cbb6f860f6c8cd8df2.1396599474.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , CPUSets have cpusets.quiesce sysfs file now, with which some CPUs can opt for isolating themselves from background kernel activities, like: timers & hrtimers. get_nohz_timer_target() is used for finding suitable CPU for firing a timer. To guarantee that new timers wouldn't be queued on quiesced CPUs, we need to modify this routine. Signed-off-by: Viresh Kumar --- kernel/sched/core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c0339e2..b235af2 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -557,17 +557,18 @@ void resched_cpu(int cpu) */ int get_nohz_timer_target(int pinned) { - int cpu = smp_processor_id(); - int i; + int cpu = smp_processor_id(), i; struct sched_domain *sd; - if (pinned || !get_sysctl_timer_migration() || !idle_cpu(cpu)) + if (pinned || !get_sysctl_timer_migration() || + !(idle_cpu(cpu) || cpu_quiesced(cpu))) return cpu; rcu_read_lock(); for_each_domain(cpu, sd) { for_each_cpu(i, sched_domain_span(sd)) { - if (!idle_cpu(i)) { + /* Don't push timers to quiesced CPUs */ + if (!(cpu_quiesced(i) || idle_cpu(i))) { cpu = i; goto unlock; }