Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1556937ybt; Thu, 2 Jul 2020 08:14:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJworgZb0Xb3mEfK6YJ1DyaYXZ+wfX6LJ+A0j49oqOyG8Pf3WYC5dGkGUxqkkytH5LNFmUIp X-Received: by 2002:a17:906:7017:: with SMTP id n23mr12142634ejj.262.1593702898929; Thu, 02 Jul 2020 08:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593702898; cv=none; d=google.com; s=arc-20160816; b=csafkGAPaCa6+0qTZ/6iPXbSDqmrw6o6jz34RfixrnCZT8VhkDvwooFVDFLMCQYfxU blrqZGfVOLapQJU9wAvpATT28xmpefmPSQx3bMCUIPyZNXSLJ8zURcVuXCEMwMzWfDs0 37PhtizlJjwKBfM1wLwn2ifZIARYm33cxCIi3qVPPKJREgOX5XAG/PHhnle/7cNOmMZL dZAtIckLFlxfvX8yZLVBVeRw0mbyQJYEMZwTdcEVdG0kEFrhnBoVbE89tP8K91W2pHfS YdBRF8UpO+kEjvYtubnOAAJoZPODTr9zgAn8fTPaLChPPCgnA8ghcl8OMgb0tgF5nVMw plSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:dkim-signature:dkim-signature:from; bh=AKOVYIcWkaX/V/hAAnCG+cs28AhmzZBR/oDllCvG+K8=; b=arUCzY6abpTFh42Br1BUrc3forTbYfRLwl+8VhvebOMzei6IgOhRz0UVYDDFiC9gOG VPxSVLzZ6aOghN7NIeOToQbaePtxZ1ohVekoGSkzKdz2i1Bj5+vxqRqhJsYND2Rmf1w6 hAi1RkJycncV1PFuunFQwJxytlh6bx3f+HsD7bT65MqaeRUNghqF60tk8K0+f9ntoFYF t10QPfa/H8SApo84M/tLFXzT1sMkiSo6otCYLoGFma9/ylFWmRmopxYerOSyaSYjXfs4 szEIfBGJn/SXsqvcyM3qxvICU9kG6XYRIN0cbUWkRFdUSQ3wxAREIcgxgRXlftLEd/CT e3rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B8IUPqy+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=zmsA1tHX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yj19si6123562ejb.410.2020.07.02.08.14.34; Thu, 02 Jul 2020 08:14:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B8IUPqy+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=zmsA1tHX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730045AbgGBPO0 (ORCPT + 99 others); Thu, 2 Jul 2020 11:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729210AbgGBPOZ (ORCPT ); Thu, 2 Jul 2020 11:14:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0D33C08C5C1 for ; Thu, 2 Jul 2020 08:14:25 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1593702864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=AKOVYIcWkaX/V/hAAnCG+cs28AhmzZBR/oDllCvG+K8=; b=B8IUPqy+gsDD3bTBeQ+G4DKptxUsoSPCdbKAO/JZrJl/JtN75ayc/WAu+ZXtHdO2ZkuIFW DsWpomCnns21VS9IoA24JetK3pWr3JukH+TcqjQsAMYPyltQKvLE2YQMLehgA68rdwO4hW 5sua8bDYQLCGZpODb669Uhv4jEzNQVjFX4nawJ9dUe3ql9BeFZ3YeVTwcH15YEZRrl6EKX QPL59CJSLd5Jagtzrf1GpcAMgFG9TjFOXW8PFDXgXeeUacGpolom73Ew8DGPoRK9wp3kGp VxnMc1YIA/OBudsRLG2676X10E0pOh7qXlrYTQPH06mSF/rTAM3fyjwikwc8pQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1593702864; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=AKOVYIcWkaX/V/hAAnCG+cs28AhmzZBR/oDllCvG+K8=; b=zmsA1tHXa7IdUCAxVy66wOf8RimLsAuCGvAXd4WXTy0JdI1s6OG2SrjzQNoUB0utGHiqUv MWb6ugZsvb4aF9CQ== To: Frederic Weisbecker Cc: LKML , Anna-Maria Gleixner , Peter Zijlstra , Juri Lelli Subject: Re: [RFC PATCH 10/10] timer: Lower base clock forwarding threshold In-Reply-To: <20200702133219.GA27417@lenoir> Date: Thu, 02 Jul 2020 17:14:23 +0200 Message-ID: <87zh8irltc.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Frederic Weisbecker writes: > On Thu, Jul 02, 2020 at 03:21:35PM +0200, Thomas Gleixner wrote: >> Frederic Weisbecker writes: >> > @@ -883,7 +883,7 @@ static inline void forward_timer_base(struct timer_base *base) >> > * Also while executing timers, base->clk is 1 offset ahead >> > * of jiffies to avoid endless requeuing to current jffies. >> > */ >> > - if ((long)(jnow - base->clk) < 2) >> > + if ((long)(jnow - base->clk) < 1) >> > return; >> >> The apparent reason is in the comment right above the condition ... > > Hmm, that's a comment I added myself in the patch before. :) > The following part: > >> > * Also while executing timers, base->clk is 1 offset ahead >> > * of jiffies to avoid endless requeuing to current jffies. >> > */ > > relates to situation when (long)(jnow - base->clk) < 0 This still is inconsistent with your changelog: > There is no apparent reason for not forwarding base->clk when it's 2 > jiffies late Let's do the math: jiffies = 4 base->clk = 2 4 - 2 = 2 which means it is forwarded when it's 2 jiffies late with the original code, because 2 < 2. The reason for this < 2 is historical and goes back to the oddities of the original timer wheel before the big rewrite. Thanks, tglx