From patchwork Wed Apr 2 05:41:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27598 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D103620341 for ; Wed, 2 Apr 2014 05:41:25 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id wp18sf39064235obc.4 for ; Tue, 01 Apr 2014 22:41:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=w6S3Wxaar7j8zXaZfmrcTfACO/9DBTvjKzNehB1x7x0=; b=CyKgrJDCw2VTf9wmmmLvnKQoliuHZZ/IZQ1kMy1vRrYeno7hXfLNd9lTTLURFL+H0l kYCySvYvLS4IsyIVQGuMza6IarK48RRGp0kw/7v4KNoyO0VUxD3O8oTss4hSn/8KI810 1sLXdS8tvbPVarIFbp5Svp6YsYuocIBzySeSkYowwFQXPBC3thHgjJst5+J8F69dvB43 /7nrXEG7jRojCHLenUXlijAFVMnpYfkP9qafm5wi0APxPj9LiJdMcBbJ91PdMg3X1wfI 1FeBO/FU3C/Gdy8pQSTSEwFFtsT0w0Jh2Sfa6osZJLqEXFRH76MXjn7YGg7fvDAVK16m h+Rw== X-Gm-Message-State: ALoCoQm5euSI9lm+AzgLmOV6n1DaUcG0GlHcqWcZyerw12uCPnq0mgOF6vhoOwmzghi35v0KaufI X-Received: by 10.42.115.129 with SMTP id k1mr2668453icq.25.1396417285051; Tue, 01 Apr 2014 22:41:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.84 with SMTP id q78ls234163qgq.69.gmail; Tue, 01 Apr 2014 22:41:24 -0700 (PDT) X-Received: by 10.52.34.137 with SMTP id z9mr28393868vdi.12.1396417284928; Tue, 01 Apr 2014 22:41:24 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id j16si282886vco.170.2014.04.01.22.41.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 22:41:24 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.169; Received: by mail-vc0-f169.google.com with SMTP id ik5so11572754vcb.28 for ; Tue, 01 Apr 2014 22:41:24 -0700 (PDT) X-Received: by 10.52.95.135 with SMTP id dk7mr5719618vdb.32.1396417284791; Tue, 01 Apr 2014 22:41:24 -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 v8csp294625vcv; Tue, 1 Apr 2014 22:41:24 -0700 (PDT) X-Received: by 10.67.3.40 with SMTP id bt8mr35294034pad.78.1396417283797; Tue, 01 Apr 2014 22:41:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ym10si521474pab.228.2014.04.01.22.41.23; Tue, 01 Apr 2014 22:41:23 -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 S1756720AbaDBFlQ (ORCPT + 27 others); Wed, 2 Apr 2014 01:41:16 -0400 Received: from mail-oa0-f54.google.com ([209.85.219.54]:34481 "EHLO mail-oa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbaDBFlO (ORCPT ); Wed, 2 Apr 2014 01:41:14 -0400 Received: by mail-oa0-f54.google.com with SMTP id n16so12383626oag.41 for ; Tue, 01 Apr 2014 22:41:13 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.200.131 with SMTP id js3mr32708465obc.0.1396417273884; Tue, 01 Apr 2014 22:41:13 -0700 (PDT) Received: by 10.182.28.168 with HTTP; Tue, 1 Apr 2014 22:41:13 -0700 (PDT) In-Reply-To: <9ea86197955aee2b751ccb5a8ea746dbd3244850.1396006658.git.viresh.kumar@linaro.org> References: <9ea86197955aee2b751ccb5a8ea746dbd3244850.1396006658.git.viresh.kumar@linaro.org> Date: Wed, 2 Apr 2014 11:11:13 +0530 Message-ID: Subject: Re: [PATCH 02/16] hrtimer: reorder code in __remove_hrtimer() From: Viresh Kumar To: Thomas Gleixner Cc: Lists linaro-kernel , Linux Kernel Mailing List , =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= , Linaro Networking , Arvind Chauhan , Viresh Kumar 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.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: , On 28 March 2014 17:11, Viresh Kumar wrote: > diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c > @@ -887,25 +887,22 @@ static void __remove_hrtimer(struct hrtimer *timer, > struct hrtimer_clock_base *base, > unsigned long newstate, int reprogram) > { > - struct timerqueue_node *next_timer; > if (!(timer->state & HRTIMER_STATE_ENQUEUED)) > goto out; > > - 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 && hrtimer_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 && hrtimer_hres_active() && > + &timer->node == timerqueue_getnext(&base->active)) { Last comparison here would always fail as we have already removed the timer. Here is a fixup for that, will include that in my V2: --- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 516c67f..189c525 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -886,15 +886,16 @@ static void __remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, unsigned long newstate, int reprogram) { + struct timerqueue_node *next_timer; if (!(timer->state & HRTIMER_STATE_ENQUEUED)) goto out; + next_timer = timerqueue_getnext(&base->active); timerqueue_del(&base->active, &timer->node); #ifdef CONFIG_HIGH_RES_TIMERS /* Reprogram the clock event device. if enabled */ - if (reprogram && hrtimer_hres_active() && - &timer->node == timerqueue_getnext(&base->active)) { + if (reprogram && hrtimer_hres_active() && &timer->node == next_timer) { ktime_t expires; expires = ktime_sub(hrtimer_get_expires(timer), base->offset);