From patchwork Wed Mar 26 11:21:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27106 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C36B020369 for ; Wed, 26 Mar 2014 11:23:29 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id bj1sf4325278pad.3 for ; Wed, 26 Mar 2014 04:23:29 -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=SF9cMnAFR00lEaNKjYklrqnazk2ffzdx+iMVCScutng=; b=G67yRSg5WGV6s+sbDkOgm7ihdLbTcFCJXnv6oisUNius5JOzzn5NfvrPfSIzfo4EQg A7LXvSQbfh6VusuqiSJS2cE/twbxxY4mud+oDgaLRF8enD3jqLsTVzgctWn/BK+JkRQi IdgqLpvC2FS26KNsg5FSvZCUyb9jp37bUtdoteRNX5/z/1skNlwbMYwzogkoCFm1v3At 8iZLVojQ9DuzoqLdxpQSL0+Gsn/vngyAZyYOeOn4Bs7td5oXTDWhV+9oIJtwlOCKtxDa yRCQysO5spaoIDZEinqyobsOQUAekOjWjFnPc9wRFETygHLEeI10nhDcHUP8snp4Vtvl 3U+Q== X-Gm-Message-State: ALoCoQlKKPKe906xW7vnSM5bdiJPVOQcjrPmRBvo2/boBcAH+0g6IdVtxcl0qASlv4vPBrTGcddx X-Received: by 10.66.121.136 with SMTP id lk8mr1292269pab.34.1395833008991; Wed, 26 Mar 2014 04:23:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.38 with SMTP id 35ls630267qgw.77.gmail; Wed, 26 Mar 2014 04:23:28 -0700 (PDT) X-Received: by 10.58.4.68 with SMTP id i4mr2487398vei.8.1395833008849; Wed, 26 Mar 2014 04:23:28 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id w5si4393010vcn.26.2014.03.26.04.23.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 04:23:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 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.171; Received: by mail-ve0-f171.google.com with SMTP id cz12so2134307veb.16 for ; Wed, 26 Mar 2014 04:23:28 -0700 (PDT) X-Received: by 10.58.154.10 with SMTP id vk10mr60320233veb.18.1395833008771; Wed, 26 Mar 2014 04:23:28 -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.78.9 with SMTP id i9csp38095vck; Wed, 26 Mar 2014 04:23:28 -0700 (PDT) X-Received: by 10.68.110.165 with SMTP id ib5mr85609451pbb.61.1395833007869; Wed, 26 Mar 2014 04:23:27 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zw7si9858230pac.193.2014.03.26.04.23.27; Wed, 26 Mar 2014 04:23:27 -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 S1754763AbaCZLW4 (ORCPT + 26 others); Wed, 26 Mar 2014 07:22:56 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:47154 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754320AbaCZLWx (ORCPT ); Wed, 26 Mar 2014 07:22:53 -0400 Received: by mail-we0-f171.google.com with SMTP id t61so1037435wes.30 for ; Wed, 26 Mar 2014 04:22:52 -0700 (PDT) X-Received: by 10.180.72.136 with SMTP id d8mr31040759wiv.44.1395832972767; Wed, 26 Mar 2014 04:22:52 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id k4sm1766766wib.19.2014.03.26.04.22.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Mar 2014 04:22:52 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, linaro-networking@linaro.org, Viresh Kumar Subject: [PATCH 11/14] hrtimer: remove active_bases field from struct hrtimer_cpu_base Date: Wed, 26 Mar 2014 16:51:17 +0530 Message-Id: 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.171 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: , Active_bases field of struct hrtimer_cpu_base is used at only one place, i.e. hrtimer_interrupt() and at that place too we can easily use timerqueue_getnext() instead to achieve the same result. I don't think this will have any performance degradation issues and so removing this field. Signed-off-by: Viresh Kumar --- include/linux/hrtimer.h | 2 -- kernel/hrtimer.c | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 6f524db..cb6a315 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -165,7 +165,6 @@ enum hrtimer_base_type { * struct hrtimer_cpu_base - the per cpu clock bases * @lock: lock protecting the base and associated clock bases * and timers - * @active_bases: Bitfield to mark bases with active timers * @clock_was_set: Indicates that clock was set from irq context. * @expires_next: absolute time of the next event which was scheduled * via clock_set_next_event() @@ -179,7 +178,6 @@ enum hrtimer_base_type { */ struct hrtimer_cpu_base { raw_spinlock_t lock; - unsigned int active_bases; unsigned int clock_was_set; #ifdef CONFIG_HIGH_RES_TIMERS ktime_t expires_next; diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 1e4eedb..f14d861 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -865,7 +865,6 @@ static int enqueue_hrtimer(struct hrtimer *timer, debug_activate(timer); timerqueue_add(&base->active, &timer->node); - base->cpu_base->active_bases |= 1 << base->index; /* * HRTIMER_STATE_ENQUEUED is or'ed to the current state to preserve the @@ -909,8 +908,6 @@ static void __remove_hrtimer(struct hrtimer *timer, } #endif } - if (!timerqueue_getnext(&base->active)) - base->cpu_base->active_bases &= ~(1 << base->index); out: timer->state = newstate; } @@ -1284,14 +1281,13 @@ retry: cpu_base->expires_next.tv64 = KTIME_MAX; for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { - struct hrtimer_clock_base *base; + struct hrtimer_clock_base *base = cpu_base->clock_base + i; struct timerqueue_node *node; ktime_t basenow; - if (!(cpu_base->active_bases & (1 << i))) + if (!timerqueue_getnext(&base->active)) continue; - base = cpu_base->clock_base + i; basenow = ktime_add(now, base->offset); while ((node = timerqueue_getnext(&base->active))) {