From patchwork Sat Jun 21 23:29:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 32309 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 35C6820CE6 for ; Sat, 21 Jun 2014 23:30:39 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id oy12sf18710875veb.10 for ; Sat, 21 Jun 2014 16:30: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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=vUVC6xHykWrs3s8il+zD3XvZvT1OaqJDp7OKamfEEoU=; b=Ry4jpbPhDkPUfTpEGD8R1u8r2HT+pRie+aSzq9ZeF7BB0Y7kyd+q30xwgP3wdP97qw wwNGpDHn6hfMnFqQO8mojLh8fxDyXUnQmoKQav7mftILHsOK8nkNm34t28mnicFpAA9s wVawDVicDB0Ii9GfIl01te7qehpf0eHRjl01Akad/suBe6PIHhsNImJs0ByfFU/girxp fH1H1WVJDmvn50f1naVIXJWDcSF/G3C7RT+uJq0nFJPoy0g4uhJ/21GTDHZp0pW79xWI GCy9COuWZJXlrZcEABJHEWiVsl7jX5aXOGp4nS4z2V2e4/+MQcrNYbrTVPbMvXEWkpzF qETA== X-Gm-Message-State: ALoCoQlDemz39m9gwkAduptczpF3AzJ+/+vN1Sq1aqHc17owHK2u/zqlLFHeDyRm/QSSqcHTud0I X-Received: by 10.58.29.67 with SMTP id i3mr5623585veh.3.1403393438986; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.37 with SMTP id g34ls1465077qgd.64.gmail; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) X-Received: by 10.52.52.168 with SMTP id u8mr8972718vdo.25.1403393438911; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [2607:f8b0:400c:c01::22e]) by mx.google.com with ESMTPS id kf15si2719694vdb.100.2014.06.21.16.30.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 16:30:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22e as permitted sender) client-ip=2607:f8b0:400c:c01::22e; Received: by mail-ve0-f174.google.com with SMTP id jx11so4779014veb.19 for ; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) X-Received: by 10.220.103.141 with SMTP id k13mr10556850vco.25.1403393438822; Sat, 21 Jun 2014 16:30: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.221.37.5 with SMTP id tc5csp44341vcb; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) X-Received: by 10.66.254.37 with SMTP id af5mr16322434pad.113.1403393438112; Sat, 21 Jun 2014 16:30:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ea5si15653498pad.63.2014.06.21.16.30.37; Sat, 21 Jun 2014 16:30:37 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753269AbaFUX3o (ORCPT + 13 others); Sat, 21 Jun 2014 19:29:44 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38461 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbaFUX33 (ORCPT ); Sat, 21 Jun 2014 19:29:29 -0400 Received: by mail-wi0-f175.google.com with SMTP id r20so2401146wiv.2 for ; Sat, 21 Jun 2014 16:29:28 -0700 (PDT) X-Received: by 10.180.96.6 with SMTP id do6mr14321743wib.44.1403393368543; Sat, 21 Jun 2014 16:29:28 -0700 (PDT) Received: from localhost.localdomain (8.20.196.77.rev.sfr.net. [77.196.20.8]) by mx.google.com with ESMTPSA id sg1sm41744wic.4.2014.06.21.16.29.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jun 2014 16:29:27 -0700 (PDT) From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Viresh Kumar , Frederic Weisbecker Subject: [PATCH 5/5] hrtimer: Remove hrtimer_enqueue_reprogram() Date: Sun, 22 Jun 2014 01:29:17 +0200 Message-Id: <1403393357-2070-6-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1403393357-2070-1-git-send-email-fweisbec@gmail.com> References: <1403393357-2070-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: fweisbec@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com 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: , From: Viresh Kumar We call hrtimer_enqueue_reprogram() only when we are in high resolution mode now so we don't need to check that again in hrtimer_enqueue_reprogram(). Once the check is removed, hrtimer_enqueue_reprogram() turns to be an useless wrapper over hrtimer_reprogram() and can be dropped. Signed-off-by: Viresh Kumar Signed-off-by: Frederic Weisbecker --- kernel/hrtimer.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 5f30917..8b3ea17 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -602,6 +602,11 @@ hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) * timers, we have to check, whether it expires earlier than the timer for * which the clock event device was armed. * + * Note, that in case the state has HRTIMER_STATE_CALLBACK set, no reprogramming + * and no expiry check happens. The timer gets enqueued into the rbtree. The + * reprogramming and expiry check is done in the hrtimer_interrupt or in the + * softirq. + * * Called with interrupts disabled and base->cpu_base.lock held */ static int hrtimer_reprogram(struct hrtimer *timer, @@ -662,18 +667,6 @@ static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) base->hres_active = 0; } -/* - * When High resolution timers are active, try to reprogram. Note, that in case - * the state has HRTIMER_STATE_CALLBACK set, no reprogramming and no expiry - * check happens. The timer gets enqueued into the rbtree. The reprogramming - * and expiry check is done in the hrtimer_interrupt or in the softirq. - */ -static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, - struct hrtimer_clock_base *base) -{ - return base->cpu_base->hres_active && hrtimer_reprogram(timer, base); -} - static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) { ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; @@ -755,8 +748,8 @@ static inline int hrtimer_is_hres_enabled(void) { return 0; } static inline int hrtimer_switch_to_hres(void) { return 0; } static inline void hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } -static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, - struct hrtimer_clock_base *base) +static inline int hrtimer_reprogram(struct hrtimer *timer, + struct hrtimer_clock_base *base) { return 0; } @@ -1025,7 +1018,7 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, */ wake_up_nohz_cpu(base->cpu_base->cpu); } else if (new_base->cpu_base == &__get_cpu_var(hrtimer_bases) && - hrtimer_enqueue_reprogram(timer, new_base)) { + hrtimer_reprogram(timer, new_base)) { /* * Only allow reprogramming if the new base is on this CPU. * (it might still be on another CPU if the timer was pending)