From patchwork Fri Apr 4 06:35:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27743 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20FFD2036E for ; Fri, 4 Apr 2014 06:42:33 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wo20sf9578174obc.2 for ; Thu, 03 Apr 2014 23:42:32 -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=zyOqe1FTYpfFYIdZ1jx8BIiaCk6qtF8s4z4tn1PcmpU=; b=ffdvJjHnnAAVemf3p2fEPkiXzjhu2vNG+MJAxz4ubP/fZXEuh3xYdyYEoNnFZgtn+A 8YWYFmsggW5zIazwtvKwAeYKFIdpmDQuZDdH0G9vJAtWT7sUlYuUeS7xqrelalg6/0fO 7WRQgD3/wFoL97piUT7ANwRFl5yr/9r3hoT4i+C+XwILmIa43PFkyV/3HW96cAgfnBnv PJINv4usLdYwBPgBFbZlAClU+ixBfjTa2fdY2Qs0UV8DYpx2rS56Z3Qb3XBX5nphAGdk hjWeVS8vBlyqmmn2L7KCPj6qNO9idSicSVRZqrCJmtqMQkO6/BAQLJa9MPwEprRS7ntZ dm6w== X-Gm-Message-State: ALoCoQm2kO5uu1/HOFZg0tSrCBn7J8eTTzaeEuiGGuitRUEUaQ5zWsQW3JxJtg6F804CDGT6YsXQ X-Received: by 10.42.216.144 with SMTP id hi16mr6102690icb.7.1396593752640; Thu, 03 Apr 2014 23:42:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.116 with SMTP id z107ls783466qge.37.gmail; Thu, 03 Apr 2014 23:42:32 -0700 (PDT) X-Received: by 10.58.220.161 with SMTP id px1mr3708799vec.13.1396593752548; Thu, 03 Apr 2014 23:42:32 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id h11si624759veh.158.2014.04.03.23.42.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:42:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so1092514veb.8 for ; Thu, 03 Apr 2014 23:42:32 -0700 (PDT) X-Received: by 10.58.74.38 with SMTP id q6mr3510420vev.7.1396593752366; Thu, 03 Apr 2014 23:42:32 -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 v8csp89277vcv; Thu, 3 Apr 2014 23:42:31 -0700 (PDT) X-Received: by 10.66.218.170 with SMTP id ph10mr12806904pac.53.1396593750038; Thu, 03 Apr 2014 23:42:30 -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.29; Thu, 03 Apr 2014 23:42:29 -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 S1752581AbaDDGl2 (ORCPT + 27 others); Fri, 4 Apr 2014 02:41:28 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:57787 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752444AbaDDGlK (ORCPT ); Fri, 4 Apr 2014 02:41:10 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so2072145wib.0 for ; Thu, 03 Apr 2014 23:41:09 -0700 (PDT) X-Received: by 10.194.63.46 with SMTP id d14mr17056356wjs.24.1396593669198; Thu, 03 Apr 2014 23:41:09 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id d6sm2723469wiz.4.2014.04.03.23.41.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:41:08 -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 14/36] hrtimer: reorder code in __remove_hrtimer() Date: Fri, 4 Apr 2014 12:05:57 +0530 Message-Id: <4914d5607cdedd99b5886b586bd178df601d8dbf.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.128.177 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: , This patch reorders code within __remove_hrtimer() routine to achieve this: - no need to check if timer is the next timer to expire when high resolution mode isn't configured in kernel. So, move this check within the #ifdef/endif block. - Validate 'reprogram' and hrtimer_hres_active() first as without these we don't need to check if 'timer' is the next one to fire. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 476ad5d..833db9f 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -891,19 +891,18 @@ static void __remove_hrtimer(struct hrtimer *timer, next_timer = timerqueue_getnext(&base->active); timerqueue_del(&base->active, &timer->node); - if (&timer->node == next_timer) { + #ifdef CONFIG_HIGH_RES_TIMERS - /* Reprogram the clock event device. if enabled */ - if (reprogram && base->cpu_base->hres_active) { - ktime_t expires; - - expires = ktime_sub(hrtimer_get_expires(timer), - base->offset); - if (base->cpu_base->expires_next.tv64 == expires.tv64) - hrtimer_force_reprogram(base->cpu_base, 1); - } -#endif + /* Reprogram the clock event device. if enabled */ + if (reprogram && base->cpu_base->hres_active && + &timer->node == next_timer) { + ktime_t expires; + + expires = ktime_sub(hrtimer_get_expires(timer), base->offset); + if (base->cpu_base->expires_next.tv64 == expires.tv64) + hrtimer_force_reprogram(base->cpu_base, 1); } +#endif if (!timerqueue_getnext(&base->active)) base->cpu_base->active_bases &= ~(1 << base->index); out: