From patchwork Tue Mar 31 06:55:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 46569 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B6A3C215A7 for ; Tue, 31 Mar 2015 06:56:00 +0000 (UTC) Received: by lbfb1 with SMTP id b1sf1548287lbf.2 for ; Mon, 30 Mar 2015 23:55:59 -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=OoOkjMEB6HiYtJkwTtBIU8Qh6b1GCGWRx2NhUhY4KkA=; b=dTX5eddlvPgC/r+95vq7ZeSual8MqsQ8Y90euUA0mkfyHmRfciDHz6maCwzK4VL8nX pbL8TmIeOnzWGEjf/Mh8IhBrMVjB91K0/T35WpwGqt4eVBdRaq0z9CHwxakhi81LnmAM 8oTJK7hZ8ohr0swbqK13+Fo92Ic0VJCk15jOq2jYnR3IJ42TZL5h5ZjiGyjcac97gmH7 L43tNyzP3YRn7p+Ag4FgqD9DE6LDoU6hGfbcr01cUMLA6GRJ4XVb9tXpSd3i6dpDGhYH NtiDnYA9aEAG25M6YxTCK6ejptZKFcu3gSWIowOzCmoZLolb2IxxDl5kgEvXTiLjNbwA mbeA== X-Gm-Message-State: ALoCoQl/ec5+1EjzX2Uwwa+0Ch0lrWR2nYLZ+T7fnDBwF8AHsUYmpQhQbSNbjqY7Gc09WsZqLwyj X-Received: by 10.180.89.36 with SMTP id bl4mr327228wib.2.1427784959723; Mon, 30 Mar 2015 23:55:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.129 with SMTP id ay1ls468870lab.61.gmail; Mon, 30 Mar 2015 23:55:59 -0700 (PDT) X-Received: by 10.112.145.230 with SMTP id sx6mr29553691lbb.70.1427784959531; Mon, 30 Mar 2015 23:55:59 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id j9si1838831lbc.32.2015.03.30.23.55.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Mar 2015 23:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbug6 with SMTP id ug6so5486872lbb.3 for ; Mon, 30 Mar 2015 23:55:59 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr15723960lbb.112.1427784959435; Mon, 30 Mar 2015 23:55:59 -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.112.57.201 with SMTP id k9csp1614373lbq; Mon, 30 Mar 2015 23:55:58 -0700 (PDT) X-Received: by 10.70.35.2 with SMTP id d2mr65503046pdj.51.1427784957723; Mon, 30 Mar 2015 23:55:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uy2si18055494pbc.107.2015.03.30.23.55.56; Mon, 30 Mar 2015 23:55:57 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752507AbbCaGzn (ORCPT + 27 others); Tue, 31 Mar 2015 02:55:43 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:35867 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbbCaGzh (ORCPT ); Tue, 31 Mar 2015 02:55:37 -0400 Received: by padcy3 with SMTP id cy3so10652485pad.3 for ; Mon, 30 Mar 2015 23:55:37 -0700 (PDT) X-Received: by 10.70.0.41 with SMTP id 9mr44275901pdb.123.1427784937432; Mon, 30 Mar 2015 23:55:37 -0700 (PDT) Received: from localhost ([122.167.118.120]) by mx.google.com with ESMTPSA id e4sm7987284pdi.64.2015.03.30.23.55.36 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Mar 2015 23:55:36 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra , Thomas Gleixner Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH 2/2] timer: Replace base-> 'running_timer' with 'busy' Date: Tue, 31 Mar 2015 12:25:17 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d 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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) 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: , We don't need to track the running timer for a cpu base anymore, but sill need to check business of base for sanity checking during CPU hotplug. Lets replace 'running_timer' with 'busy' for handle that efficiently. Signed-off-by: Viresh Kumar --- kernel/time/timer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 364644811485..2db05206594b 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -77,7 +77,7 @@ struct tvec_root { struct tvec_base { spinlock_t lock; - struct timer_list *running_timer; + bool busy; unsigned long timer_jiffies; unsigned long next_timer; unsigned long active_timers; @@ -1180,6 +1180,8 @@ static inline void __run_timers(struct tvec_base *base) spin_unlock_irq(&base->lock); return; } + + base->busy = true; while (time_after_eq(jiffies, base->timer_jiffies)) { struct list_head work_list; struct list_head *head = &work_list; @@ -1236,7 +1238,6 @@ static inline void __run_timers(struct tvec_base *base) timer_stats_account_timer(timer); - base->running_timer = timer; timer_set_running(timer); detach_expired_timer(timer, base); @@ -1270,7 +1271,7 @@ static inline void __run_timers(struct tvec_base *base) } } } - base->running_timer = NULL; + base->busy = false; spin_unlock_irq(&base->lock); } @@ -1675,7 +1676,7 @@ static void migrate_timers(int cpu) spin_lock_irq(&new_base->lock); spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); - BUG_ON(old_base->running_timer); + BUG_ON(old_base->busy); for (i = 0; i < TVR_SIZE; i++) migrate_timer_list(new_base, old_base->tv1.vec + i);