Message ID | 20230510072817.116056-2-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3435952vqo; Wed, 10 May 2023 00:46:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SZNOT4o1orN5jJybH/miEjrpwTf9UYQz/fwTEz44zYkyHOiQtflsznvydzpz4+rhE0QDM X-Received: by 2002:a17:90a:b00a:b0:250:1905:ae7b with SMTP id x10-20020a17090ab00a00b002501905ae7bmr17064151pjq.27.1683704775220; Wed, 10 May 2023 00:46:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683704775; cv=none; d=google.com; s=arc-20160816; b=gmcJPO87mCfRVY0XCIWWZGVXb5A3Oy2kaNucb7WT+JZZN95o54hzEsQZOMlvkKhbTf +/6LlL7P4uqVvdQaNPHIYWzeNzVMDkZGszjPLTt2izYiY9ei9oqZbcUYuXSRV1uVgYQ5 y62fIu30ajGRx0Eu9O4bNawJjl983lqKPpN/k66rsn8wqitDADGeX0+sB7GbMEHhISGQ jVBnAnJ2QL+Gj/UZUvc2z5JoZ1CQkY/YEhJw7qjYUfDqdkZsjwKP8acrV2XOXYiyEQcQ JVZ/x1LAtQAqmuVUrfYyOFhZF+aR6QJX/DN1NDd1312pk4/j9sPgxgJ4IhoxpqImc9Ad jNNQ== 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=PQ3NXQMtig0Ydn+DZ27wQ54KKOjUtVfs2xndfW98O6U=; b=rGD7ZpwDMtj+GI13Aa7W3x97Dqa3VGVWVUFeqw3+4gj2dDfDFwhkqhSq1fU6pZK/df UCCsCyfAO5Kkna4alKMTL8O7+BYeYIMF40t9Pxrg/LmlTEVzDJ1FfR/8KoVIPskxgwds OZdx8kCiEPCuEZ3+Dp1RQwovLdhnxOWb+EaUGIknmCv0XFDbaZY3ZmnrE45dDQtey+pN lynXeOYf4BIIZn1KEV/7ERjsafRfMVWB+Ddj7xogqmSVmCKYbFggHuVv3cAEvcKp/xZr 0ElYIi6qVqbeSP5sUeLPBBWbiDd+AeIHrbCPZ7x++53L7063SzhylclRlaomzFE9QCe8 gp/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D1z8D7w3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j76-20020a636e4f000000b00524f1f0d020si3443844pgc.465.2023.05.10.00.46.02; Wed, 10 May 2023 00:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D1z8D7w3; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235609AbjEJH2x (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Wed, 10 May 2023 03:28:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235830AbjEJH2v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 10 May 2023 03:28:51 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7C287AA7 for <linux-kernel@vger.kernel.org>; Wed, 10 May 2023 00:28:37 -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=1683703716; 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=PQ3NXQMtig0Ydn+DZ27wQ54KKOjUtVfs2xndfW98O6U=; b=D1z8D7w3JzNIOBDodikGpgba/haCLy1TxmxP/1wSCOZKJuKDVD8q6m1tAVemn7SY1VMWfX 6inJI1GFRSek4B7U+lxGZiw87qltifNke3JPTbMUysJgKWHviXMFJyHEtcUVC+7ILLMW9h nmo1GduNR6p9ELH1LAs8wPS+1y1Zy4qGBabcXVgtpq96Pi5Rm6DGeX8uMQFlHKifa2b268 qMRrYVXrF9NhOdDFIgse2Mhu5ZVo0Qtzo+AeyfIiUILGHXgxGjQmSVsjpP++ZaEKDKBBCq Q6gSE/tTo6gXH2v+zwCnuTMQQbfceTvYFc7Sg815OQlx8zkCGzNMBQ5jMKOM4A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683703716; 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=PQ3NXQMtig0Ydn+DZ27wQ54KKOjUtVfs2xndfW98O6U=; b=gouTsahUwW0QIcMnc5t/uebABITaHYIEOsA+7sqa8xzzd0gbx4fXMQfK0n2Cp3y0Ht/nMd AFCfNmzT2tNM68Aw== 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 <fweisbec@gmail.com>, 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>, Anna-Maria Behnsen <anna-maria@linutronix.de>, Frederic Weisbecker <frederic@kernel.org> Subject: [PATCH v6 01/21] tick-sched: Warn when next tick seems to be in the past Date: Wed, 10 May 2023 09:27:57 +0200 Message-Id: <20230510072817.116056-2-anna-maria@linutronix.de> In-Reply-To: <20230510072817.116056-1-anna-maria@linutronix.de> References: <20230510072817.116056-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,T_SCC_BODY_TEXT_LINE,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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765492418428451559?= X-GMAIL-MSGID: =?utf-8?q?1765492418428451559?= |
Series |
timer: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
May 10, 2023, 7:27 a.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 52254679ec48..62836490ba4d 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -831,6 +831,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) { /*