From patchwork Thu Jun 12 19:34:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 31861 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F1C392054B for ; Thu, 12 Jun 2014 19:34:22 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id uy5sf7956382obc.9 for ; Thu, 12 Jun 2014 12:34:22 -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=ks0G+bWI2d5JBwJzXjLmIj0qrBezvdocLAuVaaqrKjJbnxCo0b7o69/Pbx7RYQmnW/ g9W+3yw8mqqDe4YF0AKNDbZfhwBaGYxaJboVh7vFb4SVBmzgCn9eC+LBik9X0v9YMkdO S3WdS3UoYWQs2KbdlDm0EIFqJ6yDVny30W8SMUzKlLESu7jKLbSSg3RPQS6ZXkjZFxb8 cWYJGMTUOGE0gT4O7WEMMl1+j9bD7Co0+QIADXiiCr3dHpfrfFaou+UJYQKcWml2M21T 6gVRK/SitgmNItBt5U3psdwgf9hs3Xr2ZtcULI7k2O7oP+QAbkqPx2P45bVicyOLxzXy VUHA== X-Gm-Message-State: ALoCoQmTkVFmu63hA5hhyloy/zurUdBzK7AitpsdkNmd6VPQ6wkbpMVJ4wtS0PqK98kFBovhqsSm X-Received: by 10.51.17.10 with SMTP id ga10mr1494985igd.4.1402601662158; Thu, 12 Jun 2014 12:34:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.20.70 with SMTP id 64ls262173qgi.7.gmail; Thu, 12 Jun 2014 12:34:22 -0700 (PDT) X-Received: by 10.52.159.226 with SMTP id xf2mr9342741vdb.14.1402601662007; Thu, 12 Jun 2014 12:34:22 -0700 (PDT) Received: from mail-ve0-x22f.google.com (mail-ve0-x22f.google.com [2607:f8b0:400c:c01::22f]) by mx.google.com with ESMTPS id sk5si627381vcb.107.2014.06.12.12.34.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Jun 2014 12:34:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22f as permitted sender) client-ip=2607:f8b0:400c:c01::22f; Received: by mail-ve0-f175.google.com with SMTP id us18so2281449veb.20 for ; Thu, 12 Jun 2014 12:34:21 -0700 (PDT) X-Received: by 10.221.69.68 with SMTP id yb4mr1526599vcb.49.1402601661900; Thu, 12 Jun 2014 12:34:21 -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.54.6 with SMTP id vs6csp427989vcb; Thu, 12 Jun 2014 12:34:21 -0700 (PDT) X-Received: by 10.66.243.225 with SMTP id xb1mr23733210pac.49.1402601661069; Thu, 12 Jun 2014 12:34:21 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zd5si2135496pac.39.2014.06.12.12.34.20; Thu, 12 Jun 2014 12:34:20 -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 S1752041AbaFLTeL (ORCPT + 27 others); Thu, 12 Jun 2014 15:34:11 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:59641 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751173AbaFLTeH (ORCPT ); Thu, 12 Jun 2014 15:34:07 -0400 Received: by mail-we0-f175.google.com with SMTP id k48so1043225wev.20 for ; Thu, 12 Jun 2014 12:34:06 -0700 (PDT) X-Received: by 10.180.19.233 with SMTP id i9mr9452842wie.38.1402601646545; Thu, 12 Jun 2014 12:34:06 -0700 (PDT) Received: from localhost.localdomain (80.20.196.77.rev.sfr.net. [77.196.20.80]) by mx.google.com with ESMTPSA id ja9sm32029397wic.8.2014.06.12.12.34.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Jun 2014 12:34:05 -0700 (PDT) From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Viresh Kumar , Frederic Weisbecker Subject: [PATCH 1/2] timer: Store cpu-number in 'struct tvec_base' Date: Thu, 12 Jun 2014 21:34:00 +0200 Message-Id: <1402601641-28462-2-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1402601641-28462-1-git-send-email-fweisbec@gmail.com> References: <1402601641-28462-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::22f 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); }