From patchwork Fri Apr 4 06:35:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27766 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 12AFB206F9 for ; Fri, 4 Apr 2014 06:51:27 +0000 (UTC) Received: by mail-pb0-f71.google.com with SMTP id up15sf10875168pbc.2 for ; Thu, 03 Apr 2014 23:51:27 -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=Q+IJ3pRk3PiHRcj+rj6NYVDfv+TYzLq180Tbfc1peEI=; b=gHPylYrC913bsTcE+WaWZNnfraROMmAm84i/c3nW6EjEeAaPqUK8h62GWfKGKdu+JR 3jXL6kgEx5yvUg5+ggHW4rZDeiitizXKTFO2skkEstsqk2M3+7KrR5zpQt4M9W4FTPil HJa5tA3YbBnz3GA/d9TUcZ44n76N6yVVl0qKcMpLBPurvPbIOlVC685jRVAAsLaJtpMl qXm1X55fUwWcCM5+gLGQTvc5dKRCks7gCpIQirgu+9/x/jc8ofc3i9m8y8xy3DFz/djV beEL0wdd41zL/30dZE8/CeHetEbnEfWTx04onqZFFmm7DeXm9X0oNb0CWRmtDMe1njzs 9lhQ== X-Gm-Message-State: ALoCoQnhGwp25KrfFeUb4FXmLh6cnQh+xfhOvKi4O2GfkTT1Y6CJJMY3IKx7TaDHlcW/eyy8f1P1 X-Received: by 10.68.133.75 with SMTP id pa11mr3191263pbb.2.1396594287251; Thu, 03 Apr 2014 23:51:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.116 with SMTP id z107ls785062qge.37.gmail; Thu, 03 Apr 2014 23:51:27 -0700 (PDT) X-Received: by 10.58.220.161 with SMTP id px1mr3744258vec.13.1396594287137; Thu, 03 Apr 2014 23:51:27 -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 wy9si1655571vdc.1.2014.04.03.23.51.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:51:27 -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 lc6so2859746vcb.35 for ; Thu, 03 Apr 2014 23:51:27 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr3616979vec.15.1396594287072; Thu, 03 Apr 2014 23:51:27 -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 v8csp89755vcv; Thu, 3 Apr 2014 23:51:26 -0700 (PDT) X-Received: by 10.68.143.231 with SMTP id sh7mr13042264pbb.7.1396594285387; Thu, 03 Apr 2014 23:51:25 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iw3si4191491pac.260.2014.04.03.23.51.24; Thu, 03 Apr 2014 23:51:24 -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 S1753248AbaDDGvH (ORCPT + 27 others); Fri, 4 Apr 2014 02:51:07 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:42285 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbaDDGk6 (ORCPT ); Fri, 4 Apr 2014 02:40:58 -0400 Received: by mail-wi0-f176.google.com with SMTP id r20so591227wiv.15 for ; Thu, 03 Apr 2014 23:40:57 -0700 (PDT) X-Received: by 10.180.87.34 with SMTP id u2mr1778590wiz.3.1396593657557; Thu, 03 Apr 2014 23:40:57 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id pm5sm11019813wjc.11.2014.04.03.23.40.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Apr 2014 23:40:56 -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 12/36] hrtimer: use base->hres_active directly instead of hrtimer_hres_active() Date: Fri, 4 Apr 2014 12:05:55 +0530 Message-Id: <60a6ed11683347eb697dd739444d9c927e52e4b9.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: , retrigger_next_event() is defined within #ifdef CONFIG_HIGH_RES_TIMERS as we already have pointer to base available. So it makes more sense to simple use base->hres_active instead of doing this by calling hrtimer_hres_active(): __this_cpu_read(hrtimer_bases.hres_active) Also the same reason apply to code in __remove_hrtimer(). There is one more noticeable issue with __remove_hrtimer() without this patch. We are checking hres_active of *this cpu's* base, where as it is not guanrateed at all that __remove_hrtimer() would be called on this CPU. Specially from the migration code, timer's CPU is already down. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index b0fbf12..ad5b7ba 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -672,7 +672,7 @@ static void retrigger_next_event(void *arg) { struct hrtimer_cpu_base *base = &__get_cpu_var(hrtimer_bases); - if (!hrtimer_hres_active()) + if (!base->hres_active) return; raw_spin_lock(&base->lock); @@ -897,7 +897,7 @@ static void __remove_hrtimer(struct hrtimer *timer, if (&timer->node == next_timer) { #ifdef CONFIG_HIGH_RES_TIMERS /* Reprogram the clock event device. if enabled */ - if (reprogram && hrtimer_hres_active()) { + if (reprogram && base->cpu_base->hres_active) { ktime_t expires; expires = ktime_sub(hrtimer_get_expires(timer),