From patchwork Fri Apr 4 06:36:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27749 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8BAEC2057E for ; Fri, 4 Apr 2014 06:42:40 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf1217022igb.8 for ; Thu, 03 Apr 2014 23:42:40 -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=AMe8be47WzcHtOVJbj7qUqkLSdwpZWbqZurgjL0dZI0=; b=ivOwLkAypiIVMSbbqY8//KIB7HkcRpsH+mOhOlp0pd9u5oO09kLNe3irt/vvd8JPvC JyQmZQf599698yrqL/8R8ayS2tqnSm5XFni0NX72Gj37QFDrJI+9LWFULKgLkd6ZMJRy VeKn5IOR/lOD+4XJTTXlyIN8c1pCVxnK9drbWfBjoacL+y6rVPF853uz/n1f2fe7Lbpy 5MF74oLbBTBvNEgzTk8AKpC2h/IqruiF4K4igy5etrZPimKSvn3k7a1K9X1YR1lIYt3y IEf4JOhu5m5ouKARuuwNetX/p/aPVdE7N6sbhMqJK9YxxzAAIE214tc5VtRKkYuV+e8S 4aeQ== X-Gm-Message-State: ALoCoQlKeqUESWYPUYn96XjTfnpTS88sC5nRGiOuFwwHLXiBS3hEB6fGd63yZWHgh0wIEVvxBwG4 X-Received: by 10.43.18.133 with SMTP id qg5mr6167800icb.13.1396593760024; Thu, 03 Apr 2014 23:42:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.197 with SMTP id j63ls878141qgj.4.gmail; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) X-Received: by 10.52.51.197 with SMTP id m5mr9878126vdo.9.1396593759886; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id r19si1648263vcu.6.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.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id lc6so2853947vcb.35 for ; Thu, 03 Apr 2014 23:42:39 -0700 (PDT) X-Received: by 10.220.12.66 with SMTP id w2mr6763174vcw.15.1396593759798; Thu, 03 Apr 2014 23:42:39 -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 v8csp89291vcv; Thu, 3 Apr 2014 23:42:39 -0700 (PDT) X-Received: by 10.68.194.65 with SMTP id hu1mr12947232pbc.158.1396593755593; Thu, 03 Apr 2014 23:42:35 -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:35 -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 S1752744AbaDDGmE (ORCPT + 27 others); Fri, 4 Apr 2014 02:42:04 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:44653 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752663AbaDDGl5 (ORCPT ); Fri, 4 Apr 2014 02:41:57 -0400 Received: by mail-we0-f175.google.com with SMTP id q58so2929078wes.34 for ; Thu, 03 Apr 2014 23:41:56 -0700 (PDT) X-Received: by 10.180.93.133 with SMTP id cu5mr1685695wib.47.1396593716764; Thu, 03 Apr 2014 23:41:56 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id di9sm2722753wid.6.2014.04.03.23.41.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:41:55 -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 22/36] hrtimer: clear active_bases as soon as the timer is removed Date: Fri, 4 Apr 2014 12:06:05 +0530 Message-Id: <31d5cab755a1401e8c5e0b5041087c889f804693.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.176 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: , Timers are removed from the red-black trees from __remove_hrtimer() and after removing timer from the tree, it calls hrtimer_force_reprogram() which might use value of cpu_base->active_bases. If the timer being removed is the last one on that clock base, then cpu_base->active_bases wouldn't give the right value, as there are no timers queued on the base but active base still marks it as active. So, clear entry from active_bases as soon as timer is removed. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 2d5bb9d..379d21a 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -895,6 +895,9 @@ static void __remove_hrtimer(struct hrtimer *timer, next_timer = timerqueue_getnext(&base->active); timerqueue_del(&base->active, &timer->node); + if (!timerqueue_getnext(&base->active)) + base->cpu_base->active_bases &= ~(1 << base->index); + #ifdef CONFIG_HIGH_RES_TIMERS /* Reprogram the clock event device. if enabled */ if (reprogram && base->cpu_base->hres_active && @@ -907,8 +910,6 @@ static void __remove_hrtimer(struct hrtimer *timer, } #endif timer->state = newstate; - if (!timerqueue_getnext(&base->active)) - base->cpu_base->active_bases &= ~(1 << base->index); } /*