From patchwork Mon Mar 18 15:23:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 15402 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 0754223E3E for ; Mon, 18 Mar 2013 15:24:21 +0000 (UTC) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by fiordland.canonical.com (Postfix) with ESMTP id C129CA196D6 for ; Mon, 18 Mar 2013 15:24:20 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id m1so4411006ves.8 for ; Mon, 18 Mar 2013 08:24:20 -0700 (PDT) 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:in-reply-to:references:x-gm-message-state; bh=+KIjpP4QVbsS017bi6b8NBhEKLTFqpZ0woA13kPLtVo=; b=Yvgl4T3aA4HJg/3YOHQ05OShXjzzHGOaQtRqHHOqtELs/Mpol2mW41fi9f/jcIstLS CUZW+b4GfxpQj+iI10bWgg8PUa6WOxUxNZ+S4SxmSb1Ty8Y2d6Iskty/GC2pGEbjDkD8 3wBS8dOSjrQzU0+NS1W0O2JZilz3QXx7Or9UuXY8XoMC42ce77aDBB/nPZJTfpUTJ2MV IE7PWtBO+hiyobh35Wif/PTQjdqYFcqs1IRM2KchHrphIiVbGwfu10+89H65x28vFoRa XUu0KLuVJxE9v2nDminpfMH83OvMOFPNV0GcDcRAxNWbiqq0RehO/qYhp4aQto131wiF JSIA== X-Received: by 10.52.177.163 with SMTP id cr3mr17615514vdc.94.1363620260194; Mon, 18 Mar 2013 08:24:20 -0700 (PDT) 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.127.98 with SMTP id nf2csp28988veb; Mon, 18 Mar 2013 08:24:19 -0700 (PDT) X-Received: by 10.66.222.228 with SMTP id qp4mr10988494pac.113.1363620259234; Mon, 18 Mar 2013 08:24:19 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ho9si7057638pac.176.2013.03.18.08.24.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:24:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) smtp.mail=viresh.kumar@linaro.org Received: by mail-pb0-f50.google.com with SMTP id up1so6502773pbc.37 for ; Mon, 18 Mar 2013 08:24:18 -0700 (PDT) X-Received: by 10.66.48.233 with SMTP id p9mr11023869pan.206.1363620258713; Mon, 18 Mar 2013 08:24:18 -0700 (PDT) Received: from localhost ([122.167.69.232]) by mx.google.com with ESMTPS id ve7sm8596773pab.11.2013.03.18.08.24.12 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:24:18 -0700 (PDT) From: Viresh Kumar To: pjt@google.com, paul.mckenney@linaro.org, tglx@linutronix.de, tj@kernel.org, suresh.b.siddha@intel.com, venki@google.com, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org Cc: linaro-kernel@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, Arvind.Chauhan@arm.com, linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V3 2/7] timer: hrtimer: Don't check idle_cpu() before calling get_nohz_timer_target() Date: Mon, 18 Mar 2013 20:53:24 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQkfo3KxUV3sE5FJHQHT8UBcVmJhohGrSEFQUSwpKTElcOQjy5bHhERLHFckBUvnyBF6WFoV Check for current cpu's idleness is already done in implementation of sched_select_cpu() which is called by get_nohz_timer_target(). So, no need to call idle_cpu() twice, once from sched_select_cpu() and once from timer and hrtimer before calling get_nohz_timer_target(). This patch removes calls to idle_cpu() from timer and hrtimer. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 2 +- kernel/timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index cc47812..c56668d 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -161,7 +161,7 @@ struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, static int hrtimer_get_target(int this_cpu, int pinned) { #ifdef CONFIG_NO_HZ - if (!pinned && get_sysctl_timer_migration() && idle_cpu(this_cpu)) + if (!pinned && get_sysctl_timer_migration()) return get_nohz_timer_target(); #endif return this_cpu; diff --git a/kernel/timer.c b/kernel/timer.c index dbf7a78..83a0d3c 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -739,7 +739,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, cpu = smp_processor_id(); #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP) - if (!pinned && get_sysctl_timer_migration() && idle_cpu(cpu)) + if (!pinned && get_sysctl_timer_migration()) cpu = get_nohz_timer_target(); #endif new_base = per_cpu(tvec_bases, cpu);