From patchwork Sat Jun 21 23:29:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 32311 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1949E203F4 for ; Sat, 21 Jun 2014 23:30:42 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id va2sf14018881obc.10 for ; Sat, 21 Jun 2014 16:30:41 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=tw6ceZglJLsigkMuDfV+PVsYomLPJdYbZLM6sFFVDow=; b=RfXaY2da+EAIW47IEuZlZs/jsXxhpHlQwUujuex6yjKkmORTBDx+qjPFczkcqWDknB VoW7rlVT31i5hG1SsXORzeXb6jySm0LYEwMvPzb+QP9CHWynGtKOQrlLGu66m/Mnek15 ByEWLjU4Zsgl9qf1fNgYDDJ75VJKaTNngUTPi0LzTVkrkXRiPM+FESZSiNKRZVf0+P1D 1ijoyT4hJarJTD2u+ti221uru/b5UB31DTGHfsZwpHjTn+bilqZJV8Tnqlirrid68BE6 Jgj22S0ZwIbQGR/+iOLlBd6PEw8ujSVHL6DrOSu+HNPe6R64rmHJLzCI5UHd36Ohs4WR n78A== X-Gm-Message-State: ALoCoQmU947yQlTJC6ypnTaGQa0U+Hsr5KFN6qtjZPuttFIOYZM/2gkleXP9M/IBkwvFOZopDvPp X-Received: by 10.42.233.133 with SMTP id jy5mr4749454icb.32.1403393441703; Sat, 21 Jun 2014 16:30:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.166 with SMTP id d35ls1429094qge.3.gmail; Sat, 21 Jun 2014 16:30:41 -0700 (PDT) X-Received: by 10.221.58.144 with SMTP id wk16mr10650695vcb.23.1403393441630; Sat, 21 Jun 2014 16:30:41 -0700 (PDT) Received: from mail-ve0-x235.google.com (mail-ve0-x235.google.com [2607:f8b0:400c:c01::235]) by mx.google.com with ESMTPS id ru2si6576699vcb.19.2014.06.21.16.30.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 16:30:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::235 as permitted sender) client-ip=2607:f8b0:400c:c01::235; Received: by mail-ve0-f181.google.com with SMTP id db11so4757068veb.40 for ; Sat, 21 Jun 2014 16:30:41 -0700 (PDT) X-Received: by 10.58.8.12 with SMTP id n12mr10821010vea.28.1403393441536; Sat, 21 Jun 2014 16:30:41 -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.221.37.5 with SMTP id tc5csp44344vcb; Sat, 21 Jun 2014 16:30:41 -0700 (PDT) X-Received: by 10.66.254.136 with SMTP id ai8mr16421235pad.37.1403393440795; Sat, 21 Jun 2014 16:30:40 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ea5si15653498pad.63.2014.06.21.16.30.40; Sat, 21 Jun 2014 16:30:40 -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 S1752857AbaFUX3l (ORCPT + 13 others); Sat, 21 Jun 2014 19:29:41 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:35459 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751127AbaFUX3Y (ORCPT ); Sat, 21 Jun 2014 19:29:24 -0400 Received: by mail-wi0-f173.google.com with SMTP id cc10so2362928wib.12 for ; Sat, 21 Jun 2014 16:29:23 -0700 (PDT) X-Received: by 10.194.192.65 with SMTP id he1mr14730821wjc.91.1403393363429; Sat, 21 Jun 2014 16:29:23 -0700 (PDT) Received: from localhost.localdomain (8.20.196.77.rev.sfr.net. [77.196.20.8]) by mx.google.com with ESMTPSA id sg1sm41744wic.4.2014.06.21.16.29.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jun 2014 16:29:22 -0700 (PDT) From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Viresh Kumar , Frederic Weisbecker Subject: [PATCH 1/5] timer: Store cpu-number in 'struct tvec_base' Date: Sun, 22 Jun 2014 01:29:13 +0200 Message-Id: <1403393357-2070-2-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1403393357-2070-1-git-send-email-fweisbec@gmail.com> References: <1403393357-2070-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: fweisbec@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com 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: , From: Viresh Kumar Timers are serviced by the tick. But when a timer is enqueued on a dynticks target, we need to kick it in order to make it reconsider the next tick to schedule to correctly handle the timer's expiring time. Now while this kick is correctly performed for add_timer_on(), the mod_timer*() family has been a bit neglected. To prepare for fixing this, we need internal_add_timer() to be able to resolve the CPU target associated to a timer's object 'base' so that the kick can be centralized there. This can't be passed as an argument as not all the callers know the CPU number of a timer's base. So lets store it in the struct tvec_base to resolve the CPU without much overhead. It is set once for good at every CPU's first boot. Signed-off-by: Viresh Kumar Signed-off-by: Frederic Weisbecker --- kernel/timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/timer.c b/kernel/timer.c index 3bb01a3..9e5f4f2 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -82,6 +82,7 @@ struct tvec_base { unsigned long next_timer; unsigned long active_timers; unsigned long all_timers; + int cpu; struct tvec_root tv1; struct tvec tv2; struct tvec tv3; @@ -1568,6 +1569,7 @@ static int init_timers_cpu(int cpu) } spin_lock_init(&base->lock); tvec_base_done[cpu] = 1; + base->cpu = cpu; } else { base = per_cpu(tvec_bases, cpu); }