From nobody Sun Apr 5 16:28:26 2026 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27ED0352943 for ; Thu, 19 Feb 2026 17:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521253; cv=none; b=SChxu/YHf3F5sm1gk6bk8/fIQJRaPQywcVmnfokyAyCiJsekqh/XhGGEbi72rPUvMWXnlTAn9BAjcikrmLtnPmqzg5EUGw3GxLUq+tuaZN+YLdB+/KnQN2qGOdgOE33WUEDciepSeWzYoCGuY/kQqY1rT48yho2xgoP+vWfrgIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771521253; c=relaxed/simple; bh=KahrOTGFxHDsPLdgeyQZNnXk2bivNdYNaTpq/NJnvcw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bElNNAVE4AUsljjwbYoy4+G9cl2ImtqCxA0iYdq1LS1KpR/yAtj9HWLezuos9ugpdcwghEeUisF3OVdy614YTgSL2JGSHhtimvNJ9AbBV5fGyx2d4yXzaO58q+N7u6VfAUQAHIO2MqSrZ+0e4HM2hoWMNTvFoJKQ0u8ZVGy4BnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H+y3nH+5; arc=none smtp.client-ip=209.85.215.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H+y3nH+5" Received: by mail-pg1-f195.google.com with SMTP id 41be03b00d2f7-c70942441ebso732176a12.1 for ; Thu, 19 Feb 2026 09:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771521250; x=1772126050; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+9Ys25lUX49p5aMZ9MF04Fc/6uWbxWTtkfKKvleWffc=; b=H+y3nH+5udxeJPaKUZRwmeUgCmqkm7YFHPnKJTNeDr3CfyNHftRhVT40mM/Petkfby JZUa9gBuCzTIEqAOkBue2YF9cPXtetwjNWQHnSKrtit/9mtFTjSTma2/ZwrqeZ5DW03c cOJ5LkbTZxAHG7UA0XvpzH3YSzmit8QsXOTyWxG8vpTX0j2QEX8jEsH4N0lsu+UVNt1K oFjhWbPktQv0rpIqayOEuhg93WaLjpJymoLlmVk8u3F66eBkFmfJRwDfdJbmWLBsdHJ/ fiijiIpW6wDG0bb4sPKc7n/WCEIb5rwoe7/yzt9FSqbqiX5xiKOCfcVHye4eM8+BpTsg Su4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771521250; x=1772126050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+9Ys25lUX49p5aMZ9MF04Fc/6uWbxWTtkfKKvleWffc=; b=PPGkW4GfodT5BBeAnnBMA1Xp62qCRiQK2PWok+O+Lmq0KFIa9QLAjs90kzGbO9lKJz JpTiAMWrtpCMrkV3OihcqWzHe9r0l53p1YGlCt676IbClZ0OA+ymZSBaOzht5jTtyYoc fFp0jyQlhxYB3+uG2wDQLI9XWgV1qILRcAeiSIH8o2ouCDrE5Ao1avYqy047q6lRSAp+ TuyM627vNQhbCtwCqyOJyRpXkGwXYg5hxuvx2//WQLOkCmK+z5LJAgZCIdlD3GnOYPxn +ru9+GeKkVXRMQkVof2/HOKO2ya1TqC9ZZ1gamRaxb9rMXNn7wmsxz9X2S0N5vjOfjSA cI3A== X-Forwarded-Encrypted: i=1; AJvYcCWuHx5+y2/qICWhCTgnhvW14DfdG8Ku+CLC6/r0jhFsk7ASKwXRfVnGEJ9iGYk6k0TZ4G/PGaUEaRoI3RM=@vger.kernel.org X-Gm-Message-State: AOJu0YzdITj7kfNWzgEM3ZnA4gPCcTHnEWYnKIgxPBP6K5shGSVovI6O GpXFG9nkVs8+KE0ArdYIH8GyPDZLH001F6TZxP+mjc8YWdhKoNsH9m1Z X-Gm-Gg: AZuq6aJ2c379Pph4CIo9CXHeQQgDI6GNWdulzW1lex4eKFuOhukI0YGva2rJEM3uvfC n/QkFjB+LW8uol6B8WqwUe5rtfAFPIGTECs5aPxZcMLPhgrDVgLC2STGZdkR2WEk8JOk0xfuehc UHXOw0qqQ7wGKpy6Xv7/QN9XkLBYf0MDKtrIubOHVFpjEDIhXBePVcwITFj/01e6Sppw2kvMmWv kw9/zJcHFQz+ti+Yvi1W4hxu83JSr5sOfqcU/M+tXEHmwL1DA9bMOaAoSf6QK3kAJwxpWC0gKCS BCZ+Ssea03NkQner1ZFuCEeVJAlLo4jfKM+9Tj/y0KxZmFNbSTWZP01FZ8vKBWLpSmKqCjNOFM2 9L2VljS77aipQm7LeksXnb1sHZ8i7jknk3djBZGLp0wTtcpPPepQD+/iC8z86hx5bu9BZGxUezK 8wNECve2f2EOi9EriyH+JBUyRoDbsPBB98pVN2BvdwwpfnMRAr2Q== X-Received: by 2002:a05:6a21:7785:b0:395:1869:f63c with SMTP id adf61e73a8af0-3951869f8e7mr1782258637.18.1771521250511; Thu, 19 Feb 2026 09:14:10 -0800 (PST) Received: from name2965-Precision-7820-Tower.. ([121.185.236.165]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c6e532fa2e5sm15895002a12.26.2026.02.19.09.14.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Feb 2026 09:14:09 -0800 (PST) From: Jeongjun Park To: stable@vger.kernel.org Cc: gregkh@linuxfoundation.org, tglx@linutronix.de, Julia.Lawall@inria.fr, akpm@linux-foundation.org, anna-maria@linutronix.de, arnd@arndb.de, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, linux@roeck-us.net, luiz.dentz@gmail.com, marcel@holtmann.org, maz@kernel.org, peterz@infradead.org, rostedt@goodmis.org, sboyd@kernel.org, viresh.kumar@linaro.org, zouyipeng@huawei.com, aha310510@gmail.com, linux-staging@lists.linux.dev, Jacob Keller Subject: [PATCH 5.10.y 13/15] timers: Update the documentation to reflect on the new timer_shutdown() API Date: Fri, 20 Feb 2026 02:13:08 +0900 Message-Id: <20260219171310.118170-14-aha310510@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260219171310.118170-1-aha310510@gmail.com> References: <20260219171310.118170-1-aha310510@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" [ Upstream commit a31323bef2b66455920d054b160c17d4240f8fd4 ] In order to make sure that a timer is not re-armed after it is stopped before freeing, a new shutdown state is added to the timer code. The API timer_shutdown_sync() and timer_shutdown() must be called before the object that holds the timer can be freed. Update the documentation to reflect this new workflow. [ tglx: Updated to the new semantics and updated the zh_CN version ] Signed-off-by: Steven Rostedt (Google) Signed-off-by: Thomas Gleixner Tested-by: Guenter Roeck Reviewed-by: Jacob Keller Reviewed-by: Anna-Maria Behnsen Link: https://lore.kernel.org/r/20221110064147.712934793@goodmis.org Link: https://lore.kernel.org/r/20221123201625.375284489@linutronix.de Signed-off-by: Jeongjun Park --- Documentation/RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Docum= entation/RCU/Design/Requirements/Requirements.rst index ad2cc20131ec..e8af3dc3c95a 100644 --- a/Documentation/RCU/Design/Requirements/Requirements.rst +++ b/Documentation/RCU/Design/Requirements/Requirements.rst @@ -1858,7 +1858,7 @@ unloaded. After a given module has been unloaded, any= attempt to call one of its functions results in a segmentation fault. The module-unload functions must therefore cancel any delayed calls to loadable-module functions, for example, any outstanding ``mod_timer()`` must be dealt -with via ``timer_delete_sync()`` or similar. +with via ``timer_shutdown_sync()`` or similar. =20 Unfortunately, there is no way to cancel an RCU callback; once you invoke ``call_rcu()``, the callback function is eventually going to be diff --git a/Documentation/core-api/local_ops.rst b/Documentation/core-api/= local_ops.rst index a84f8b0c7ab2..0b42ceaaf3c4 100644 --- a/Documentation/core-api/local_ops.rst +++ b/Documentation/core-api/local_ops.rst @@ -191,7 +191,7 @@ Here is a sample module which implements a basic per cp= u counter using =20 static void __exit test_exit(void) { - timer_delete_sync(&test_timer); + timer_shutdown_sync(&test_timer); } =20 module_init(test_init); diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kerne= l-hacking/locking.rst index 86ac2f4d24f7..4b8fd764aa7f 100644 --- a/Documentation/kernel-hacking/locking.rst +++ b/Documentation/kernel-hacking/locking.rst @@ -1016,6 +1016,11 @@ calling add_timer() at the end of their timer functi= on). Because this is a fairly common case which is prone to races, you should use timer_delete_sync() (``include/linux/timer.h``) to handle this case. =20 +Before freeing a timer, timer_shutdown() or timer_shutdown_sync() should be +called which will keep it from being rearmed. Any subsequent attempt to +rearm the timer will be silently ignored by the core code. + + Locking Speed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --