[SRU][F][PATCH v3 10/16] Documentation: Replace del_timer/del_timer_sync()
Massimiliano Pellizzer
massimiliano.pellizzer at canonical.com
Fri Nov 29 17:00:11 UTC 2024
From: Thomas Gleixner <tglx at linutronix.de>
Adjust to the new preferred function names.
Suggested-by: Steven Rostedt <rostedt at goodmis.org>
Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
Reviewed-by: Jacob Keller <jacob.e.keller at intel.com>
Reviewed-by: Anna-Maria Behnsen <anna-maria at linutronix.de>
Link: https://lore.kernel.org/r/20221123201625.075320635@linutronix.de
(backported from commit 87bdd932e85881895d4720255b40ac28749c4e32)
[mpellizzer: backported adjusting context due to missing commits in the
Documentation folder]
CVE-2024-35887
Signed-off-by: Massimiliano Pellizzer <massimiliano.pellizzer at canonical.com>
---
.../RCU/Design/Requirements/Requirements.html | 2 +-
Documentation/core-api/local_ops.rst | 2 +-
Documentation/kernel-hacking/locking.rst | 10 +++++-----
Documentation/timers/hrtimers.rst | 2 +-
.../translations/it_IT/kernel-hacking/locking.rst | 10 +++++-----
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Documentation/RCU/Design/Requirements/Requirements.html b/Documentation/RCU/Design/Requirements/Requirements.html
index 467251f7fef6..5dc41e703847 100644
--- a/Documentation/RCU/Design/Requirements/Requirements.html
+++ b/Documentation/RCU/Design/Requirements/Requirements.html
@@ -2342,7 +2342,7 @@ 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 <tt>mod_timer()</tt> must be dealt with
-via <tt>del_timer_sync()</tt> or similar.
+via <tt>timer_delete_sync()</tt> or similar.
<p>
Unfortunately, there is no way to cancel an RCU callback;
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 cpu counter using
static void __exit test_exit(void)
{
- del_timer_sync(&test_timer);
+ timer_delete_sync(&test_timer);
}
module_init(test_init);
diff --git a/Documentation/kernel-hacking/locking.rst b/Documentation/kernel-hacking/locking.rst
index 564488842987..c91fbe62679a 100644
--- a/Documentation/kernel-hacking/locking.rst
+++ b/Documentation/kernel-hacking/locking.rst
@@ -976,7 +976,7 @@ you might do the following::
while (list) {
struct foo *next = list->next;
- del_timer(&list->timer);
+ timer_delete(&list->timer);
kfree(list);
list = next;
}
@@ -990,7 +990,7 @@ the lock after we :c:func:`spin_unlock_bh()`, and then try to free
the element (which has already been freed!).
This can be avoided by checking the result of
-:c:func:`del_timer()`: if it returns 1, the timer has been deleted.
+:c:func:`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::
@@ -999,7 +999,7 @@ do::
while (list) {
struct foo *next = 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;
@@ -1014,7 +1014,7 @@ do::
Another common problem is deleting timers which restart themselves (by
calling :c:func:`add_timer()` at the end of their timer function).
Because this is a fairly common case which is prone to races, you should
-use :c:func:`del_timer_sync()` (``include/linux/timer.h``) to
+use :c:func:`timer_delete_sync()` (``include/linux/timer.h``) to
handle this case.
Locking Speed
@@ -1343,7 +1343,7 @@ lock.
- :c:func:`kfree()`
-- :c:func:`add_timer()` and :c:func:`del_timer()`
+- :c:func:`add_timer()` and :c:func:`timer_delete()`
Mutex API reference
===================
diff --git a/Documentation/timers/hrtimers.rst b/Documentation/timers/hrtimers.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 suited. 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 direct
1:1 mapping between them on the algorithmic level, and thus no real
potential for code sharing either.
diff --git a/Documentation/translations/it_IT/kernel-hacking/locking.rst b/Documentation/translations/it_IT/kernel-hacking/locking.rst
index 74ae5168b6f7..f7d8504ac1c9 100644
--- a/Documentation/translations/it_IT/kernel-hacking/locking.rst
+++ b/Documentation/translations/it_IT/kernel-hacking/locking.rst
@@ -998,7 +998,7 @@ potreste fare come segue::
while (list) {
struct foo *next = list->next;
- del_timer(&list->timer);
+ timer_delete(&list->timer);
kfree(list);
list = next;
}
@@ -1011,7 +1011,7 @@ e prenderà il *lock* solo dopo :c:func:`spin_unlock_bh()`, e cercherà
di eliminare il suo oggetto (che però è già stato eliminato).
Questo può essere evitato controllando il valore di ritorno di
-:c:func:`del_timer()`: se ritorna 1, il temporizzatore è stato già
+:c:func:`timer_delete()`: se ritorna 1, il temporizzatore è stato già
rimosso. Se 0, significa (in questo caso) che il temporizzatore è in
esecuzione, quindi possiamo fare come segue::
@@ -1020,7 +1020,7 @@ esecuzione, quindi possiamo fare come segue::
while (list) {
struct foo *next = 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;
@@ -1034,7 +1034,7 @@ esecuzione, quindi possiamo fare come segue::
Un altro problema è l'eliminazione dei temporizzatori che si riavviano
da soli (chiamando :c:func:`add_timer()` alla fine della loro esecuzione).
Dato che questo è un problema abbastanza comune con una propensione
-alle corse critiche, dovreste usare :c:func:`del_timer_sync()`
+alle corse critiche, dovreste usare :c:func:`timer_delete_sync()`
(``include/linux/timer.h``) per gestire questo caso.
Velocità della sincronizzazione
@@ -1382,7 +1382,7 @@ contesto, o trattenendo un qualsiasi *lock*.
- :c:func:`kfree()`
-- :c:func:`add_timer()` e :c:func:`del_timer()`
+- :c:func:`add_timer()` e :c:func:`timer_delete()`
Riferimento per l'API dei Mutex
===============================
--
2.43.0
More information about the kernel-team
mailing list