From patchwork Thu Jul 31 16:45:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Weisbecker X-Patchwork-Id: 34678 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D095D20540 for ; Thu, 31 Jul 2014 16:46:21 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id cm18sf6344241qab.3 for ; Thu, 31 Jul 2014 09:46:21 -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=IXjxRUrFMn92LUhQbjgphiIu32NsyIn9hp15iMxxMbc=; b=iiyuP4bDPbb1ck9JQQCxNNEcDnPNjwzWTyuQoTMtr02/VuoJFecjlx/LHKr6GxyQLs SSZBarU978RySkpinDfsUbPH/5mV0WNzgksHHHW/cnCYcUv6TbWxaxw51rjl07tFYr5q BRtP9VVV5fUBfdH/NoO3FoiheTe+wIXWp6dphj3rjNOInfi7DhLTfWGu5YnI912PfxQj dps3iTFtyVCF/+9RIc4zqHJswGCPeKwZur4ms7oBeKZ1L4BIcvn7tq+HDC/PGRfe/zuv ZSlwHxkCKDsuB1N4ZWcWDUwaOmBqR461cPmCBsbRCPP6qObRM6jkSNWH9BxCIbpftYcS 6oIQ== X-Gm-Message-State: ALoCoQlABQEFs0q2T0vc3NcpilXULHDSDLuYMc0j0nZRo/w8MCfLP+QYjQr3g99e+Eu6mw/mrwPc X-Received: by 10.236.102.239 with SMTP id d75mr1766330yhg.21.1406825181343; Thu, 31 Jul 2014 09:46:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.68 with SMTP id h62ls979820qge.52.gmail; Thu, 31 Jul 2014 09:46:21 -0700 (PDT) X-Received: by 10.52.1.39 with SMTP id 7mr16166392vdj.17.1406825181266; Thu, 31 Jul 2014 09:46:21 -0700 (PDT) Received: from mail-vc0-x236.google.com (mail-vc0-x236.google.com [2607:f8b0:400c:c03::236]) by mx.google.com with ESMTPS id ym14si4995856vdc.50.2014.07.31.09.46.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Jul 2014 09:46:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::236 as permitted sender) client-ip=2607:f8b0:400c:c03::236; Received: by mail-vc0-f182.google.com with SMTP id hy4so4762060vcb.27 for ; Thu, 31 Jul 2014 09:46:21 -0700 (PDT) X-Received: by 10.52.129.165 with SMTP id nx5mr16214288vdb.25.1406825181141; Thu, 31 Jul 2014 09:46: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.37.5 with SMTP id tc5csp33286vcb; Thu, 31 Jul 2014 09:46:20 -0700 (PDT) X-Received: by 10.66.161.69 with SMTP id xq5mr5838390pab.62.1406825180340; Thu, 31 Jul 2014 09:46:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si3282716pdo.267.2014.07.31.09.46.19 for ; Thu, 31 Jul 2014 09:46: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 S1753268AbaGaQqQ (ORCPT + 19 others); Thu, 31 Jul 2014 12:46:16 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:38991 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbaGaQqN (ORCPT ); Thu, 31 Jul 2014 12:46:13 -0400 Received: by mail-wi0-f181.google.com with SMTP id bs8so4451907wib.8 for ; Thu, 31 Jul 2014 09:46:11 -0700 (PDT) X-Received: by 10.180.73.139 with SMTP id l11mr17598871wiv.30.1406825171009; Thu, 31 Jul 2014 09:46:11 -0700 (PDT) Received: from localhost.localdomain.com (8.20.196.77.rev.sfr.net. [77.196.20.8]) by mx.google.com with ESMTPSA id lk7sm14525230wjb.24.2014.07.31.09.46.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jul 2014 09:46:10 -0700 (PDT) From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Viresh Kumar , Frederic Weisbecker Subject: [PATCH 2/2] nohz: Avoid tick's double reprogramming in highres mode Date: Thu, 31 Jul 2014 18:45:56 +0200 Message-Id: <1406825156-11901-3-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1406825156-11901-1-git-send-email-fweisbec@gmail.com> References: <1406825156-11901-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:c03::236 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 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 b07ba8e..a7098f7 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1087,6 +1087,10 @@ static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) if (regs) tick_sched_handle(ts, regs); + /* Do not restart, when 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;