From patchwork Mon Apr 14 16:23:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 28344 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CED0920534 for ; Mon, 14 Apr 2014 16:27:05 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id vb8sf11662952obc.7 for ; Mon, 14 Apr 2014 09:27:05 -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=pHlQ1PvVTKAbvk6dAfKFUJ4UQqp5dRi8zoF+ZEMzDZ0=; b=WVUh9mGEyFmUDzS2It8BGxcWtCYwJ34NuBccB/L4q+EccXPlMyaYIKj27cI7OUNlhU dpn74+WNwkR/KhHLXzcbMhEOG3kwoIwpq8CSvO2/GyuAe/C8GKdazFsYIbKlWljXrJ0m XAfzjVL515DVfw1bmxcY7w3E2VzDZMD8VidXUVY5RQHnQLT3jGt7YXyHhPcfyUcBtKPi 7Wkzi+r/7lI2xp1sJfWwdBDl0srJdqWPINk0oGQs7cEJJGMtSiYtW+EkIckhdYPkjHiZ EdXP9WSvkivjGOCE0CvYnA/tFyS0zgS4ZDpt7uy5FFqhBo97uEBwbThkP5ez72gGs0JK KHMQ== X-Gm-Message-State: ALoCoQmuQn3hd/1rZERTA8GoS/eGq5iuKOKp/I1NLUkDstyHGT0goOWvmZWl3vOTeXDGGD/L+4N6 X-Received: by 10.42.223.10 with SMTP id ii10mr4921255icb.21.1397492825391; Mon, 14 Apr 2014 09:27:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.163 with SMTP id a32ls2746418qgf.73.gmail; Mon, 14 Apr 2014 09:27:05 -0700 (PDT) X-Received: by 10.220.163.3 with SMTP id y3mr10007062vcx.7.1397492825142; Mon, 14 Apr 2014 09:27:05 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id d9si2834894vca.134.2014.04.14.09.27.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:27:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so8100874veb.28 for ; Mon, 14 Apr 2014 09:27:05 -0700 (PDT) X-Received: by 10.58.230.103 with SMTP id sx7mr2045090vec.28.1397492825064; Mon, 14 Apr 2014 09:27:05 -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.221.72 with SMTP id ib8csp162831vcb; Mon, 14 Apr 2014 09:27:04 -0700 (PDT) X-Received: by 10.66.164.201 with SMTP id ys9mr45276543pab.40.1397492824372; Mon, 14 Apr 2014 09:27:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yb4si4894320pab.431.2014.04.14.09.27.03; Mon, 14 Apr 2014 09:27:03 -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 S1755741AbaDNQ0y (ORCPT + 26 others); Mon, 14 Apr 2014 12:26:54 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:57444 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755717AbaDNQ0t (ORCPT ); Mon, 14 Apr 2014 12:26:49 -0400 Received: by mail-pa0-f46.google.com with SMTP id kx10so8406335pab.19 for ; Mon, 14 Apr 2014 09:26:49 -0700 (PDT) X-Received: by 10.68.162.1 with SMTP id xw1mr4386072pbb.128.1397492809175; Mon, 14 Apr 2014 09:26:49 -0700 (PDT) Received: from localhost ([122.167.126.16]) by mx.google.com with ESMTPSA id qv9sm27806838pbc.71.2014.04.14.09.26.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Apr 2014 09:26:48 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, Arvind.Chauhan@arm.com, linaro-networking@linaro.org, Viresh Kumar Subject: [PATCH 25/38] tick-sched: don't call local_softirq_pending() thrice in can_stop_idle_tick() Date: Mon, 14 Apr 2014 21:53:47 +0530 Message-Id: <46cbce23e1293fd2257ec2ad55026f0d673b9fa6.1397492345.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.169 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: , can_stop_idle_tick() checks if a local softirq is pending or not, and in case it is pending we call the same routine two more times. Rather store the value in a local variable and reuse it. Signed-off-by: Viresh Kumar --- kernel/time/tick-sched.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 5a99859..b7b09b9 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -691,6 +691,8 @@ static void tick_nohz_full_stop_tick(struct tick_sched *ts) static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) { + unsigned int softirq; + /* * If this cpu is offline and it is the one which updates * jiffies, then give up the assignment and let it be taken by @@ -712,13 +714,11 @@ static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) if (need_resched()) return false; - if (unlikely(local_softirq_pending())) { + if (unlikely((softirq = local_softirq_pending()))) { static int ratelimit; - if (ratelimit < 10 && - (local_softirq_pending() & SOFTIRQ_STOP_IDLE_MASK)) { - pr_warn("NOHZ: local_softirq_pending %02x\n", - (unsigned int) local_softirq_pending()); + if (ratelimit < 10 && (softirq & SOFTIRQ_STOP_IDLE_MASK)) { + pr_warn("NOHZ: local_softirq_pending %02x\n", softirq); ratelimit++; } return false;