From patchwork Fri Apr 4 06:36:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27748 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f71.google.com (mail-pb0-f71.google.com [209.85.160.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EE81D2036E for ; Fri, 4 Apr 2014 06:42:39 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id up15sf10836703pbc.10 for ; Thu, 03 Apr 2014 23:42:39 -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=v0yH54JeCx0ZzOGMEWfdp9Nd7Aq4SVhXfLnfwN/HwXU=; b=Ubu+AF4r+QPmYl2zg/nAXlbba1D3CPgLBqsKQuDIlj5TURreud5i1Ut0+ivoPLIYr2 0H6nIDF3PWjDjNHOT1apd6BnOGAsz2ZDFywvqM+x4oEWFXAqDNC0OhLcc0/hVzdr8klO ipgxabcg+r2g0fa6LXOYpTVrH5yJnOjAoaH1YPpnv8kvLh34pZfyd4g0ZtLu0wF1n774 vB3qkzAEpMXGTSRt5wgeGs37VUGFkV2ZGRxL0x1oFabsvZZtckpWaAuCLgVQZwmc03MZ N+WyLHfsnI01mLW+Ost2fNjKJzMVYp5d7j13fifnk3jtdBObyk8VgTAfUyOjDF/H7Uf/ W2wQ== X-Gm-Message-State: ALoCoQmTigXtxjwM7OE09ru7LUJdVOTM6yXon9vh9Q3xLtzqpXaYWMbIpnuN89lPpGBEtx8bYpBL X-Received: by 10.66.183.239 with SMTP id ep15mr3778036pac.7.1396593759145; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.105 with SMTP id y96ls902729qgd.82.gmail; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) X-Received: by 10.52.108.164 with SMTP id hl4mr9693225vdb.25.1396593759017; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id vd8si1635768vdc.106.2014.04.03.23.42.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id ld13so2730092vcb.5 for ; Thu, 03 Apr 2014 23:42:38 -0700 (PDT) X-Received: by 10.220.170.202 with SMTP id e10mr6831646vcz.20.1396593758934; Thu, 03 Apr 2014 23:42:38 -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 v8csp89290vcv; Thu, 3 Apr 2014 23:42:38 -0700 (PDT) X-Received: by 10.66.171.76 with SMTP id as12mr12966535pac.52.1396593754807; Thu, 03 Apr 2014 23:42:34 -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.34; Thu, 03 Apr 2014 23:42:34 -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 S1752716AbaDDGl5 (ORCPT + 27 others); Fri, 4 Apr 2014 02:41:57 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:63525 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbaDDGlw (ORCPT ); Fri, 4 Apr 2014 02:41:52 -0400 Received: by mail-wi0-f182.google.com with SMTP id d1so596580wiv.3 for ; Thu, 03 Apr 2014 23:41:50 -0700 (PDT) X-Received: by 10.180.103.227 with SMTP id fz3mr1721405wib.29.1396593710853; Thu, 03 Apr 2014 23:41:50 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id v6sm2733597wif.0.2014.04.03.23.41.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:41:50 -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 21/36] hrtimer: create base_on_this_cpu() Date: Fri, 4 Apr 2014 12:06:04 +0530 Message-Id: <698f137afe7bee33391033aff95218dbf54be301.1396592516.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.220.174 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 had this code at two places to find if a clock base belongs to current CPU: base->cpu_base == &__get_cpu_var(hrtimer_bases) Better to get a inlined routine for that. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 458b952..2d5bb9d 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -107,6 +107,10 @@ static inline int hrtimer_clockid_to_base(clockid_t clock_id) return hrtimer_clock_to_base_table[clock_id]; } +static inline bool base_on_this_cpu(struct hrtimer_clock_base *base) +{ + return base->cpu_base == &__get_cpu_var(hrtimer_bases); +} /* * Get the coarse grained time at the softirq based on xtime and @@ -933,8 +937,7 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) * move the timer base in switch_hrtimer_base. */ state = timer->state & HRTIMER_STATE_CALLBACK; - __remove_hrtimer(timer, base, state, - base->cpu_base == &__get_cpu_var(hrtimer_bases)); + __remove_hrtimer(timer, base, state, base_on_this_cpu(base)); return 1; } @@ -980,7 +983,7 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, * * XXX send_remote_softirq() ? */ - if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases) + if (leftmost && base_on_this_cpu(new_base) && hrtimer_enqueue_reprogram(timer, new_base)) { if (wakeup) { /*