From patchwork Fri Aug 22 17:09:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 35861 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DD7E520540 for ; Fri, 22 Aug 2014 17:10:04 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id r2sf49158888igi.0 for ; Fri, 22 Aug 2014 10:10:04 -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=V3+PEezjVgx9+4UmkkYJqmsjZbNUGx5A0TextneU6gI=; b=LcQ1DxgyH95xfvZDS3SicRda9Bs4BQXi+utG8oJRnNYTX+vEi84u+tEljPNLARHfQJ ViG1hUddc78DynSJSV85k2Z+xEueG5IwqM+BFeuoo/Fm16gCVcwbHl71CDKPS7kJiYPL m70HHV+i4K1xgOn4WU5MYPnQXDcDWIZsfhrYR8TMR+/MdEqypUCjSQ84oTzoD/kHEvPL ubjFkXD30oaKRgsRfePRKcp8Ya6wxh8CPFI8rip156nkvd9GnW2Z9cKxzn4xgct4DkWn EXVIsUBQ5eQPLVQwQeXxDEKG9hqfMsEALJHzGLrAhywqrgB3k3BeodLEuFaWCzBCqOr9 /cVw== X-Gm-Message-State: ALoCoQkApzqZhNFV1VGqawCYIl5uRNy5hb8I8gAhRocC1BOZuiJ6bs4hvQF1h+tlwR+uWqqJxO4W X-Received: by 10.42.133.200 with SMTP id i8mr6841003ict.14.1408727404430; Fri, 22 Aug 2014 10:10:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.202 with SMTP id k68ls1344531qge.48.gmail; Fri, 22 Aug 2014 10:10:04 -0700 (PDT) X-Received: by 10.220.86.72 with SMTP id r8mr1147247vcl.36.1408727404278; Fri, 22 Aug 2014 10:10:04 -0700 (PDT) Received: from mail-vc0-x22e.google.com (mail-vc0-x22e.google.com [2607:f8b0:400c:c03::22e]) by mx.google.com with ESMTPS id hn5si14014051vdb.51.2014.08.22.10.10.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 10:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::22e as permitted sender) client-ip=2607:f8b0:400c:c03::22e; Received: by mail-vc0-f174.google.com with SMTP id la4so12601630vcb.19 for ; Fri, 22 Aug 2014 10:10:04 -0700 (PDT) X-Received: by 10.53.12.225 with SMTP id et1mr3903899vdd.5.1408727404202; Fri, 22 Aug 2014 10:10:04 -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.45.67 with SMTP id uj3csp32525vcb; Fri, 22 Aug 2014 10:10:03 -0700 (PDT) X-Received: by 10.68.252.229 with SMTP id zv5mr8303891pbc.16.1408727403270; Fri, 22 Aug 2014 10:10:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pb7si1797342pdb.225.2014.08.22.10.10.02 for ; Fri, 22 Aug 2014 10:10:03 -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 S932699AbaHVRJv (ORCPT + 21 others); Fri, 22 Aug 2014 13:09:51 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:42230 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932297AbaHVRJo (ORCPT ); Fri, 22 Aug 2014 13:09:44 -0400 Received: by mail-we0-f172.google.com with SMTP id x48so10958554wes.3 for ; Fri, 22 Aug 2014 10:09:42 -0700 (PDT) X-Received: by 10.194.206.67 with SMTP id lm3mr6700014wjc.70.1408727382860; Fri, 22 Aug 2014 10:09:42 -0700 (PDT) Received: from localhost.localdomain (4be54-h03-87-88-245-150.dsl.sta.abo.bbox.fr. [87.88.245.150]) by mx.google.com with ESMTPSA id lj18sm33116834wic.8.2014.08.22.10.09.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Aug 2014 10:09:42 -0700 (PDT) From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Viresh Kumar , Thomas Gleixner , Frederic Weisbecker Subject: [PATCH 2/2] nohz: Avoid tick's double reprogramming in highres mode Date: Fri, 22 Aug 2014 19:09:33 +0200 Message-Id: <1408727373-8166-3-git-send-email-frederic@kernel.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1408727373-8166-1-git-send-email-frederic@kernel.org> References: <1408727373-8166-1-git-send-email-frederic@kernel.org> 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:c03::22e 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 highres mode, the tick reschedules itself unconditionally to the next jiffies. However while this clock reprogramming is relevant when the tick is in periodic mode, it's not that interesting when we run in dynticks mode because irq exit is likely going to overwrite the next tick to some randomly deferred future. So lets just get rid of this tick self rescheduling in dynticks mode. This way we can avoid some clockevents double write in favourable scenarios like when we stop the tick completely in idle while no other hrtimer is pending. Suggested-by: Frederic Weisbecker Signed-off-by: Viresh Kumar Cc: Thomas Gleixner Signed-off-by: Frederic Weisbecker --- kernel/time/tick-sched.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 153870a..cc0a5b6 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1099,6 +1099,10 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) if (regs) tick_sched_handle(ts, regs); + /* No need to reprogram if we are in idle or full dynticks mode */ + if (unlikely(ts->tick_stopped)) + return HRTIMER_NORESTART; + hrtimer_forward(timer, now, tick_period); return HRTIMER_RESTART;