From patchwork Fri Apr 4 06:36:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27752 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D9FAB2036E for ; Fri, 4 Apr 2014 06:42:42 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf5339076ykp.1 for ; Thu, 03 Apr 2014 23:42:42 -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=GnCckedKfjfuXBnui4mlk/ZuPBvAjqgIbKEHb+jyWQ0=; b=f2ghfmalS4yomhu8dwEzxYcF04hndRuQ5cCa1TadVLFUSu9MQ08sj96o+dyMXsqdgC uAmd+1SrjWqi+dSPpzzqTGYdgolpDInCLNW2mv09+5V5ANeWbJetAS+70/M2uRNR8Bmk D0lNfS2FePH7Qv1inE2v+NjIhjNyFaehOIwDlkqDAHOA018yMaggVgrBmrVoYfqqmLG6 DR+WIoQl53/ThfEgo8zmY+903BZFNO8KGx67fadS+waaEdkYur/7pH6dxldNMT3lF+U0 Gcr+g1i/CGr5Dn+XaqhJ8N3ly4F/Qr2Gqv527Tivvd5kigzlI8U5tdD7YvPfXXs1Hg2s hgyQ== X-Gm-Message-State: ALoCoQn2Yek+0Eb5VGdrEU/cpZBUeQ8oeGYYsJqHTIGLBrKRCj4rvFMibMBGT+4HmLafcGPgD7t/ X-Received: by 10.236.91.107 with SMTP id g71mr5510459yhf.53.1396593762673; Thu, 03 Apr 2014 23:42:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.131 with SMTP id z3ls932269qgd.59.gmail; Thu, 03 Apr 2014 23:42:42 -0700 (PDT) X-Received: by 10.58.105.105 with SMTP id gl9mr3542696veb.3.1396593762600; Thu, 03 Apr 2014 23:42:42 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id ud3si51055vdc.10.2014.04.03.23.42.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so2766562vcb.24 for ; Thu, 03 Apr 2014 23:42:42 -0700 (PDT) X-Received: by 10.58.74.38 with SMTP id q6mr3511095vev.7.1396593762500; Thu, 03 Apr 2014 23:42:42 -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 v8csp89297vcv; Thu, 3 Apr 2014 23:42:42 -0700 (PDT) X-Received: by 10.66.241.66 with SMTP id wg2mr12905417pac.132.1396593758574; Thu, 03 Apr 2014 23:42:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xt7si4198997pab.20.2014.04.03.23.42.37; Thu, 03 Apr 2014 23:42:37 -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 S1752831AbaDDGmW (ORCPT + 27 others); Fri, 4 Apr 2014 02:42:22 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:45223 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752732AbaDDGmP (ORCPT ); Fri, 4 Apr 2014 02:42:15 -0400 Received: by mail-wi0-f171.google.com with SMTP id q5so593055wiv.10 for ; Thu, 03 Apr 2014 23:42:14 -0700 (PDT) X-Received: by 10.180.75.202 with SMTP id e10mr1798306wiw.50.1396593734142; Thu, 03 Apr 2014 23:42:14 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id l10sm2693775wiz.18.2014.04.03.23.42.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:13 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, fweisbec@gmail.com, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 25/36] hrtimer: call hrtimer_get_softirq_time() only if cpu_base->active_bases is set Date: Fri, 4 Apr 2014 12:06:08 +0530 Message-Id: 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.220.179 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: , We need to call hrtimer_get_softirq_time() only once for a cpu_base from hrtimer_run_queues(). And it shouldn't be called if there are no timers queued for that cpu_base. Currently we are managing this with help of a variable: gettime. This part of code can be simplified by using cpu_base->active_bases instead. With this we can get rid of the 'if' block from the loop iterating over all clock bases. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index b3ab19a..2d9a7e2 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1458,19 +1458,16 @@ void hrtimer_run_queues(void) struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases); struct hrtimer_clock_base *base; unsigned int active_bases; - int index, gettime = 1; + int index; if (hrtimer_hres_active()) return; - for_each_active_base(index, base, cpu_base, active_bases) { - if (gettime) { - hrtimer_get_softirq_time(cpu_base); - gettime = 0; - } + if (cpu_base->active_bases) + hrtimer_get_softirq_time(cpu_base); + for_each_active_base(index, base, cpu_base, active_bases) { raw_spin_lock(&cpu_base->lock); - while ((node = timerqueue_getnext(&base->active))) { struct hrtimer *timer;