Message ID | 20231004123454.15691-3-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp98455vqb; Wed, 4 Oct 2023 05:36:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPofLG74TbVqSliXpshxEo5uJhlcvSJT9xx3VBxQsiaV0s0CMExrQrnGeNL++Vi4J0Q9Vk X-Received: by 2002:a17:90a:f414:b0:271:8195:8 with SMTP id ch20-20020a17090af41400b0027181950008mr1905651pjb.36.1696422991431; Wed, 04 Oct 2023 05:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696422991; cv=none; d=google.com; s=arc-20160816; b=DnZbBIZ6hovMMr2zgTBS4nBPfRE8BNwUI50eSKphPUj9rgFvdj1/RpsWZuVy8PE1IC q2tDtjLG9t95wgvPyigNmjXiVmMh29BDgf7m+ci2cDM4OAMy/1bjINUUiu5ZBTFOHUe+ oDRwy0K04IW6MVfML6eZoB80xBhNyxGn0n4GtBVrwVBM75/aC5ukfDu6+A5QfgX+7Pit 6IFwcLJg4H6y5WAWiZxiijzbY6QrhhdlHK4EfoNRLJ6qJqPLIcsCo+GVbcNm9Bfwj1ul TxSJWsFLPDIK058Uy0TGH10HFWKPwHUhwoqEYWfyfCtfDKvKmTG359eUccOrnlTSekIx Fx4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=Qz4nJBaG6XRtjj3mRkMTDjA4wkxAWKGzl0cHJtp9Oe0=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=kIrI+iyzHL/R4NUkcv7d5TMYVtPgdMQDYCrKY5x+qpk8/Q5sxITTJpEFRxNQwTEeYt LPJzWvPJx22fprScw4I07W7EyL9Q0h0aoa6Ltmi47xwHRCrvI4k2DtMRQmKtktBRRn7t ZOA3aKxo7/eSXhl9MPT3dxmeOtMieTJV0a57dZbRjjOsSxtqf8hFIw7ogam0/aWu1ARH ldJQthA7H3NosBT6g7x8IHWTmUlnincZ3djk6PhktewUsbDeopSSoHCXb5JHhQGGN0I2 ++4Omqr0lxs3E1gbQfdkBzS2WynN6SUdwf6DS1P/57us2Ep9t1+ZxkKL8oiR35yOPjfH 3dhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BIozC7Py; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id lr17-20020a17090b4b9100b002747da1ef66si1523346pjb.53.2023.10.04.05.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 05:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=BIozC7Py; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4ADE18045959; Wed, 4 Oct 2023 05:35:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242375AbjJDMff (ORCPT <rfc822;pusanteemu@gmail.com> + 18 others); Wed, 4 Oct 2023 08:35:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbjJDMfc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Oct 2023 08:35:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A09CB0 for <linux-kernel@vger.kernel.org>; Wed, 4 Oct 2023 05:35:28 -0700 (PDT) From: Anna-Maria Behnsen <anna-maria@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696422927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qz4nJBaG6XRtjj3mRkMTDjA4wkxAWKGzl0cHJtp9Oe0=; b=BIozC7PyZ4VhQOCf4rAfBpbcQ7TgnF/JfDtlw7mlsRDKvWNbWOyEamfwSre+uzcIh8bmNQ MNg+c1mk0p6wtXauMY8pQrNRb5+qGggoexuscNVjelnE8Sv6zezgM6Ym7tiaEQTBHbKlEo t9qGlU7wzEpmqeQ2yWwqvCUsvocrgXbc/Zg2Dn4AEpdo2TNzL3j7PGIzH2cpdBvwDtFYEI 6HlUqNBd9Evc7k30v5rm1GNYhBITNjeTggg3PwIjZUKVEx/vEkrRdLvouCEyODoFyL2c3q /WGvqyUNT2/uvcFL45xHRBWxSP5Qm4DAB1CTgpc2yLbS/xQag2tChfePA+o7Ew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696422927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qz4nJBaG6XRtjj3mRkMTDjA4wkxAWKGzl0cHJtp9Oe0=; b=CHFn5XMk74YVpQGH5n+8y0lqHnXKS2zTHVWFKCa+56NDFEzcfcQW4uiJDc6bqoVS8IKl4w majPpeh3Rwnn8WBw== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org>, John Stultz <jstultz@google.com>, Thomas Gleixner <tglx@linutronix.de>, Eric Dumazet <edumazet@google.com>, "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>, Arjan van de Ven <arjan@infradead.org>, "Paul E . McKenney" <paulmck@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Rik van Riel <riel@surriel.com>, Steven Rostedt <rostedt@goodmis.org>, Sebastian Siewior <bigeasy@linutronix.de>, Giovanni Gherdovich <ggherdovich@suse.cz>, Lukasz Luba <lukasz.luba@arm.com>, "Gautham R . Shenoy" <gautham.shenoy@amd.com>, Srinivas Pandruvada <srinivas.pandruvada@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Anna-Maria Behnsen <anna-maria@linutronix.de> Subject: [PATCH v8 02/25] tick-sched: Warn when next tick seems to be in the past Date: Wed, 4 Oct 2023 14:34:31 +0200 Message-Id: <20231004123454.15691-3-anna-maria@linutronix.de> In-Reply-To: <20231004123454.15691-1-anna-maria@linutronix.de> References: <20231004123454.15691-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 05:35:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778828434734728123 X-GMAIL-MSGID: 1778828434734728123 |
Series |
timer: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
Oct. 4, 2023, 12:34 p.m. UTC
When the next tick is in the past, the delta between basemono and the next tick gets negativ. But the next tick should never be in the past. The negative effect of a wrong next tick might be a stop of the tick and timers might expire late. To prevent expensive debugging when changing underlying code, add a WARN_ON_ONCE into this code path. Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> --- kernel/time/tick-sched.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index bdad2abdc0c7..b3cf535881a4 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -842,6 +842,8 @@ static ktime_t tick_nohz_next_event(struct tick_sched *ts, int cpu) * If the tick is due in the next period, keep it ticking or * force prod the timer. */ + WARN_ON_ONCE(basemono > next_tick); + delta = next_tick - basemono; if (delta <= (u64)TICK_NSEC) { /*