From nobody Mon Dec 1 22:36:19 2025 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 5A53D2C0F89 for ; Fri, 28 Nov 2025 16:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764345993; cv=none; b=NXuXMjOUoC2dzYT4IreB0ntSAgkVNaPRhI4IXfjNVxWnOw/ulNMGPvVfc9KbFFq6X2qNgUk/MIpCMb+8zleqtNfBVd6VlG2Psxq0baB2WbN/2vqC42I/5xF8aZmLMfZZP/Tq7MxCSYpfkOnC5kpTnfJTVZfhJmBM+KokFqyndRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764345993; c=relaxed/simple; bh=upWSCwkwQ09Z4avIiv+Y6wEsIG3+TFZ3n19V8cmDwBA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=SWxLAoPLE4YJHBS4too7krbp0YMo4YyMsxQWW5LPFUt3uho1Q9OtKrDBc5O3sZtroM9FG14D9f6qKNGkUnLNgzbmrqCAgETd/JO9TPK7wqTmctfZ/UpCRkdEnJuscF2Q9UMZr66z/IiniyRopnXhBdsuZCV2n6CMIq4yGFBaPjE= 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=EcQPz8uG; arc=none smtp.client-ip=209.85.210.178 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="EcQPz8uG" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-7aab7623f42so2212381b3a.2 for ; Fri, 28 Nov 2025 08:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764345990; x=1764950790; 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=NwuFHJSwTOh44O6o4YH5Gva/YZZ2KpNq4JaQIOiJzpU=; b=EcQPz8uGQl4K+txb3Y9EM2dWKSUYXg6OdmgUo3d6PJ4cH2DlBvOHkRBqQnEXN8cvhC 3D/HSsJoU9IceNabHiudkyVLNmzgv/DkxytcDhQN4thfvuwDCadGgF9F+JWCG6QgAFZ8 /xxvDFP0S15gRiX9gpEUpYdo/2aERv2edG37L/4COtKaU43u4JlfL3/IKJANIvIL6YN6 Q8sLulTac8U9M5dHSgjJ6WHZL1uko0Zr2bAFKTUkSeZcffOoHhPShxbCU6WUP1UVnFyt twfb93Bg1b45IqzxsT5UsNWXLcEradh4CO9zttXwhe9qSul4+raj95xhrKMXieIcob3+ wBuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764345990; x=1764950790; 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=NwuFHJSwTOh44O6o4YH5Gva/YZZ2KpNq4JaQIOiJzpU=; b=v/oHtVPa4/2uSG+2KHaXAHbMDYiD8Ham1ouHxFshSVe9xcqqC+i3Cn2eVslIBLIQj8 nmQ5v0rOQRMPEeWR2DmUps+5OjpP3cHOl1fHw93UUhC0E+6hTVhGZx+jDAg4ZPbeDQhd 1wOY3rbdKwwgHjvh+pjP09XFY3PCTj6a/qFqOt/WHVKKdbyJoWuLi07q3xMYbLDpMYRv 5s94DNSCZgTw/RIl0Ttken7AmA+pHipujnRBWyQ6R2WUr17lCpG/8ShT3a0h2lvHZ5iK IK+ahSW4P72Nh3Oibeu24DSKHYU3XZmc9PqGdQ4gCI23TaiNbrbhzO7Ihu3cVFiU0eqs kGig== X-Forwarded-Encrypted: i=1; AJvYcCXHNAUZ6eOwyL75yHCuILRQBEHfn9KmUp9QOAp36x7WAqXYN8A8GO+Pz+ZVD91vJfFpyM32+ECWTO+rM14=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+WzE12L+kwWfXqhNQbCQczT+6TWmi9exDYaAez7leKtmDdlEo GDKWZJqAtzLUiSKmB7Fpa41LwXUPGhlxUob8j7D7Ktz2f8RIfftcm+Lb X-Gm-Gg: ASbGncs2ekJd9QFQdPQfd0SFojdqPl5tBrvwdzsQHP/ILF4UXs7B5npplNdPRYk7jnq xRNT0QIHFLvzun3zG+rRiZN5QPrs3S521mWM7Tx129kb1uFezy9xKlk19frAHRW/a/U2f2blLst 9dfWHB88NvuG4ePNbUfgf0Dd0GRhevOKUnOOzySAHW77sMy0Wy+S5r5DcP1jdhoWi4GdlWS8JRu MWsJyCZqnAOTkrMUbqw/AQSr+ajmv7Lt6z4l5TTTJTzzuLadqXg7VnK+6NyEjlvmUkXvumk5Xhf CRAsbqgAGyT/tTAF0RPknRQ7OCNzP9QQQa0vu7OsTHqCqYgXx96d7S260i4ajh/BIhxvJTUvxTf kyV8NBhpPL1pMkzqyBn61YaiNtqlhFsPXcA9sMsdJ1GxYrRn8Ydv/+IPTdqXb717w+Jhc+I4gr/ W1+QAL1OpEdGdbyeenAY9L39KACLVRXguK8DkPtw== X-Google-Smtp-Source: AGHT+IHkZ+vfxp4JqrSHcbC8AyzXlNJ0OxaL9SKjjazgTqeaBUUhfQyzRwIoWRt7hmUNiS6wX+LdAw== X-Received: by 2002:a05:6a20:430f:b0:361:2f3e:cac2 with SMTP id adf61e73a8af0-3614eda843dmr33153993637.33.1764345989932; Fri, 28 Nov 2025 08:06:29 -0800 (PST) Received: from name2965-Precision-7820-Tower.. ([121.185.186.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7d15f26f11fsm5408499b3a.50.2025.11.28.08.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Nov 2025 08:06:29 -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, aha310510@gmail.com, linux-staging@lists.linux.dev, Jacob Keller Subject: [PATCH 5.15.y 08/14] Documentation: Replace del_timer/del_timer_sync() Date: Sat, 29 Nov 2025 01:05:33 +0900 Message-Id: <20251128160539.358938-9-aha310510@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20251128160539.358938-1-aha310510@gmail.com> References: <20251128160539.358938-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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Thomas Gleixner [ Upstream commit 87bdd932e85881895d4720255b40ac28749c4e32 ] Adjust to the new preferred function names. Suggested-by: Steven Rostedt Signed-off-by: Thomas Gleixner Reviewed-by: Jacob Keller Reviewed-by: Anna-Maria Behnsen Link: https://lore.kernel.org/r/20221123201625.075320635@linutronix.de Signed-off-by: Jeongjun Park --- .../RCU/Design/Requirements/Requirements.rst | 2 +- Documentation/core-api/local_ops.rst | 2 +- Documentation/kernel-hacking/locking.rst | 11 +++++------ Documentation/timers/hrtimers.rst | 2 +- .../translations/it_IT/kernel-hacking/locking.rst | 10 +++++----- .../translations/zh_CN/core-api/local_ops.rst | 2 +- 6 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Docum= entation/RCU/Design/Requirements/Requirements.rst index a0f8164c8513..546f23abeca3 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 del_timer_sync() or similar. +with via timer_delete_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 2ac3f9f29845..a84f8b0c7ab2 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) { - del_timer_sync(&test_timer); + timer_delete_sync(&test_timer); } =20 module_init(test_init); diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kerne= l-hacking/locking.rst index b26e4a3a9b7e..c447d55fa080 100644 --- a/Documentation/kernel-hacking/locking.rst +++ b/Documentation/kernel-hacking/locking.rst @@ -967,7 +967,7 @@ you might do the following:: =20 while (list) { struct foo *next =3D list->next; - del_timer(&list->timer); + timer_delete(&list->timer); kfree(list); list =3D next; } @@ -981,7 +981,7 @@ the lock after we spin_unlock_bh(), and then try to free the element (which has already been freed!). =20 This can be avoided by checking the result of -del_timer(): if it returns 1, the timer has been deleted. +timer_delete(): if it returns 1, the timer has been deleted. If 0, it means (in this case) that it is currently running, so we can do:: =20 @@ -990,7 +990,7 @@ do:: =20 while (list) { struct foo *next =3D list->next; - if (!del_timer(&list->timer)) { + if (!timer_delete(&list->timer)) { /* Give timer a chance to delete this = */ spin_unlock_bh(&list_lock); goto retry; @@ -1005,8 +1005,7 @@ do:: Another common problem is deleting timers which restart themselves (by calling add_timer() at the end of their timer function). Because this is a fairly common case which is prone to races, you should -use del_timer_sync() (``include/linux/timer.h``) to -handle this case. +use timer_delete_sync() (``include/linux/timer.h``) to =20 Locking Speed =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1334,7 +1333,7 @@ lock. =20 - kfree() =20 -- add_timer() and del_timer() +- add_timer() and timer_delete() =20 Mutex API reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/Documentation/timers/hrtimers.rst b/Documentation/timers/hrtim= ers.rst index c1c20a693e8f..7ac448908d1f 100644 --- a/Documentation/timers/hrtimers.rst +++ b/Documentation/timers/hrtimers.rst @@ -118,7 +118,7 @@ existing timer wheel code, as it is mature and well sui= ted. Sharing code was not really a win, due to the different data structures. Also, the hrtimer functions now have clearer behavior and clearer names - such as hrtimer_try_to_cancel() and hrtimer_cancel() [which are roughly -equivalent to del_timer() and del_timer_sync()] - so there's no direct +equivalent to timer_delete() and timer_delete_sync()] - so there's no dire= ct 1:1 mapping between them on the algorithmic level, and thus no real potential for code sharing either. =20 diff --git a/Documentation/translations/it_IT/kernel-hacking/locking.rst b/= Documentation/translations/it_IT/kernel-hacking/locking.rst index eddfba806e13..b8ecf41273c5 100644 --- a/Documentation/translations/it_IT/kernel-hacking/locking.rst +++ b/Documentation/translations/it_IT/kernel-hacking/locking.rst @@ -990,7 +990,7 @@ potreste fare come segue:: =20 while (list) { struct foo *next =3D list->next; - del_timer(&list->timer); + timer_delete(&list->timer); kfree(list); list =3D next; } @@ -1003,7 +1003,7 @@ e prender=C3=A0 il *lock* solo dopo spin_unlock_bh(),= e cercher=C3=A0 di eliminare il suo oggetto (che per=C3=B2 =C3=A8 gi=C3=A0 stato eliminato= ). =20 Questo pu=C3=B2 essere evitato controllando il valore di ritorno di -del_timer(): se ritorna 1, il temporizzatore =C3=A8 stato gi=C3=A0 +timer_delete(): se ritorna 1, il temporizzatore =C3=A8 stato gi=C3=A0 rimosso. Se 0, significa (in questo caso) che il temporizzatore =C3=A8 in esecuzione, quindi possiamo fare come segue:: =20 @@ -1012,7 +1012,7 @@ esecuzione, quindi possiamo fare come segue:: =20 while (list) { struct foo *next =3D list->next; - if (!del_timer(&list->timer)) { + if (!timer_delete(&list->timer)) { /* Give timer a chance to delete this = */ spin_unlock_bh(&list_lock); goto retry; @@ -1026,7 +1026,7 @@ esecuzione, quindi possiamo fare come segue:: Un altro problema =C3=A8 l'eliminazione dei temporizzatori che si riavviano da soli (chiamando add_timer() alla fine della loro esecuzione). Dato che questo =C3=A8 un problema abbastanza comune con una propensione -alle corse critiche, dovreste usare del_timer_sync() +alle corse critiche, dovreste usare timer_delete_sync() (``include/linux/timer.h``) per gestire questo caso. =20 Velocit=C3=A0 della sincronizzazione @@ -1372,7 +1372,7 @@ contesto, o trattenendo un qualsiasi *lock*. =20 - kfree() =20 -- add_timer() e del_timer() +- add_timer() e timer_delete() =20 Riferimento per l'API dei Mutex =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D diff --git a/Documentation/translations/zh_CN/core-api/local_ops.rst b/Docu= mentation/translations/zh_CN/core-api/local_ops.rst index 41e4525038e8..22493b9b829c 100644 --- a/Documentation/translations/zh_CN/core-api/local_ops.rst +++ b/Documentation/translations/zh_CN/core-api/local_ops.rst @@ -185,7 +185,7 @@ UP=E4=B9=8B=E9=97=B4=E6=B2=A1=E6=9C=89=E4=B8=8D=E5=90= =8C=E7=9A=84=E8=A1=8C=E4=B8=BA=EF=BC=8C=E5=9C=A8=E4=BD=A0=E7=9A=84=E6=9E=B6= =E6=9E=84=E7=9A=84 ``local.h`` =E4=B8=AD=E5=8C=85=E6=8B=AC ``asm-g =20 static void __exit test_exit(void) { - del_timer_sync(&test_timer); + timer_delete_sync(&test_timer); } =20 module_init(test_init); --