From patchwork Sat Jun 21 23:29:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 32312 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6C7B3203F4 for ; Sat, 21 Jun 2014 23:30:52 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id f51sf12010984qge.6 for ; Sat, 21 Jun 2014 16:30:52 -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=M2RGuRK7Vrj4I8AzBW8tV82jhsrB63OxyCnoa3Qgu8E=; b=ldsv5nl/YOnlNAT1zJMi9F8HVrsUb4P7XnihMc0jL+Psd+oD6z3Nf6hmbeUpor3Kja 2S/9TL4ZvTU6JM18wCe5qQ58EKoKxMV+Sv3amNxq4A5trY2soNClL6wXXRKICKXYcYwu RZWOXoxarNbQsQ95ThfOZJ+E6HM0ZcRQV3Fb8xD8O8T75inMO79+BhsluN9cX5YtmrVG XLB7/5oRHyt99+kK+AKUmNQ6MiSyyh6m8rr9hbuy4GqQ+IJ2u0HYcs8zQnfMN+lRG7bs 3GtInFWVhx/GVUprrcdXsu5cJnZNdaCtOJ2Tk+eL6mNvd7szdSoDUYBo1adLftqIaGmn CX5g== X-Gm-Message-State: ALoCoQmL6R82NMYmJ+SheZrEOPm00NoowVpteWfXkxaFWyRC8bpG84kFI43w05cS6Z1YFHgujLYI X-Received: by 10.236.26.105 with SMTP id b69mr5322390yha.55.1403393452240; Sat, 21 Jun 2014 16:30:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.133 with SMTP id t5ls1499868qgt.43.gmail; Sat, 21 Jun 2014 16:30:52 -0700 (PDT) X-Received: by 10.58.132.41 with SMTP id or9mr10820274veb.5.1403393452138; Sat, 21 Jun 2014 16:30:52 -0700 (PDT) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [2607:f8b0:400c:c01::229]) by mx.google.com with ESMTPS id yh7si6556506vdb.69.2014.06.21.16.30.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 21 Jun 2014 16:30:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::229 as permitted sender) client-ip=2607:f8b0:400c:c01::229; Received: by mail-ve0-f169.google.com with SMTP id pa12so4895018veb.0 for ; Sat, 21 Jun 2014 16:30:52 -0700 (PDT) X-Received: by 10.52.117.209 with SMTP id kg17mr8983579vdb.28.1403393452068; Sat, 21 Jun 2014 16:30:52 -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 tc5csp44355vcb; Sat, 21 Jun 2014 16:30:51 -0700 (PDT) X-Received: by 10.66.121.197 with SMTP id lm5mr16554472pab.118.1403393451385; Sat, 21 Jun 2014 16:30:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hk10si15650352pac.55.2014.06.21.16.30.50; Sat, 21 Jun 2014 16:30:50 -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 S1752623AbaFUX3j (ORCPT + 13 others); Sat, 21 Jun 2014 19:29:39 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:62569 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbaFUX31 (ORCPT ); Sat, 21 Jun 2014 19:29:27 -0400 Received: by mail-we0-f178.google.com with SMTP id x48so5333188wes.9 for ; Sat, 21 Jun 2014 16:29:26 -0700 (PDT) X-Received: by 10.180.228.6 with SMTP id se6mr14321864wic.52.1403393365952; Sat, 21 Jun 2014 16:29:25 -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.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jun 2014 16:29:25 -0700 (PDT) From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Viresh Kumar , Frederic Weisbecker Subject: [PATCH 3/5] hrtimer: Store cpu-number in 'struct hrtimer_cpu_base' Date: Sun, 22 Jun 2014 01:29:15 +0200 Message-Id: <1403393357-2070-4-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::229 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 In lowres mode, hrtimers are serviced by the tick instead of a clock event. Now it works well as long as the tick stays periodic but we must also make sure that the hrtimers are serviced in dynticks mode. Part of that job consist in kicking a dynticks hrtimer target in order to make it reconsider the next tick to schedule to correctly handle the hrtimer's expiring time. And that part isn't handled by the hrtimers subsystem. To prepare for fixing this, we need __hrtimer_start_range_ns() to be able to resolve the CPU target associated to a hrtimer's object 'cpu_base' so that the kick can be centralized there. So lets store it in the 'struct hrtimer_cpu_base' to resolve the CPU without overhead. It is set once at CPU's online notification. Signed-off-by: Viresh Kumar Signed-off-by: Frederic Weisbecker --- include/linux/hrtimer.h | 2 ++ kernel/hrtimer.c | 1 + 2 files changed, 3 insertions(+) diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index e7a8d3f..bb4ffff 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -165,6 +165,7 @@ enum hrtimer_base_type { * struct hrtimer_cpu_base - the per cpu clock bases * @lock: lock protecting the base and associated clock bases * and timers + * @cpu: cpu number * @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 @@ -179,6 +180,7 @@ enum hrtimer_base_type { */ struct hrtimer_cpu_base { raw_spinlock_t lock; + unsigned int cpu; unsigned int active_bases; unsigned int clock_was_set; #ifdef CONFIG_HIGH_RES_TIMERS diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 3ab2899..0e32d4e 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1680,6 +1680,7 @@ static void init_hrtimers_cpu(int cpu) timerqueue_init_head(&cpu_base->clock_base[i].active); } + cpu_base->cpu = cpu; hrtimer_init_hres(cpu_base); }