Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5230113imm; Tue, 31 Jul 2018 07:35:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcTwpNaQlhsEDMMAmdQAfXqQMPteoICPXOArOHmI91RCJ71AMGMVvz9YixJw1WfqEDKRBwX X-Received: by 2002:a63:ab0c:: with SMTP id p12-v6mr20529896pgf.190.1533047748722; Tue, 31 Jul 2018 07:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533047748; cv=none; d=google.com; s=arc-20160816; b=zdNRIyu6v3NzVNBx+NIxu9eiBEo0v+vjfcfLaTAQX6s+wxYe5sSgRjvscYESl82lNz PHnWHNgZtsuETFlgZ4RzkkrjZoXD6qxe4mPApDTLsxWW1L6G7DRcUJXSVJY5FdCXVN9x hNZSBLg36AAXZplOTWJtT4GHedRykt8Df3WxCHHPJ7cdGG+0qKTjItytzDMYPtn1CX6e f0000gXDZfaeq9eMTeUJ6RFkirXID6jMXXgEjpEmeeYlcIN7jb8CBv/Iwwqlia+Tmfdt nupjQs6PkxwKqEYZpdYwIZHTSsFQ+QB7hG9KfMbsdTrxUfAj6fnlYs0j32YkqSmfAcVN tAdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=qoAzoFWhyv8eQrQaleXjGZ7hStu76qTzE8tNuHOliFk=; b=ZOBF9Ec7rCbCwRj5F0iiPuGVcs7po4yvA4rkg47I2Dh5xkEV9qBgQDwVlrRMYUC/VJ TqEYaeFunCr3EE9GnnyBcceNB44j9og2zJgyeYgDiCI5uvYYtLx7dZmZa13Jf9qh+lou DvURv0AhR2jZ5EvPji3uFwtOeGN2rm+Azz6MVO+EmULcJiOwqtgsSGBD2vr50Gy4WIfJ 8fp6KsCi+gCji8BuGKyna7x6ChqASAIjvAqeNAcCNjV7ndANIX/Qwn263jD7Xy+Pqzpo andG6Gi5gy0oLwVOpDpPP/llmAtzpV0kuqnFt/y1dbwHJqhkKK0+qF+vEm9pvtZNASBd 91qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i62-v6si14510336pfc.217.2018.07.31.07.35.33; Tue, 31 Jul 2018 07:35:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732361AbeGaQPS (ORCPT + 99 others); Tue, 31 Jul 2018 12:15:18 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:59878 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732231AbeGaQPS (ORCPT ); Tue, 31 Jul 2018 12:15:18 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fkVjR-0005wV-Is; Tue, 31 Jul 2018 16:34:37 +0200 Date: Tue, 31 Jul 2018 16:34:37 +0200 (CEST) From: Thomas Gleixner To: Xu YiPing cc: john.stultz@linaro.org, sboyd@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] timers: fix offset calculation when the expires align with LVL_GRAN In-Reply-To: Message-ID: References: <1532669610-103892-1-git-send-email-xuyiping@hisilicon.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 31 Jul 2018, Thomas Gleixner wrote: > On Tue, 31 Jul 2018, Xu YiPing wrote: > > On 2018/7/30 19:03, Thomas Gleixner wrote: > > > > > > __internal_add_timer(base, timer) > > > { > > > idx = calc_wheel_index(1, 1) > > > { > > > delta = 1 - 1; <- 0 > > > > > > if (0 < LVL_START(1)) > > > idx = calc_index(1, 0) > > > { > > > expires = (1 + LVL_GRAN(0) - 1) >> LVL_SHIFT(0); > > > ----> expires = 0 > > > > LVL_GRAN(0) = 1 and LVL_SHIFT(0) = 0 > > > > after the calculation, expires = 1 ? > > Indeed. You're right. Math is hard... So the index would be 1 and still not > fulfil the below: Hmm, crap. Let me think about it some more. 34C is way too hot to think. Thanks, tglx