[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <173989786160.10177.12467937104358294915.tip-bot2@tip-bot2>
Date: Tue, 18 Feb 2025 16:57:41 -0000
From: "tip-bot2 for Nam Cao" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Nam Cao <namcao@...utronix.de>, Thomas Gleixner <tglx@...utronix.de>,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: timers/cleanups] io_uring: Use helper function
hrtimer_update_function()
The following commit has been merged into the timers/cleanups branch of tip:
Commit-ID: 3f8d93d1371f460ed30ebfa30fb930c0605035fc
Gitweb: https://git.kernel.org/tip/3f8d93d1371f460ed30ebfa30fb930c0605035fc
Author: Nam Cao <namcao@...utronix.de>
AuthorDate: Wed, 05 Feb 2025 11:55:14 +01:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Tue, 18 Feb 2025 17:41:35 +01:00
io_uring: Use helper function hrtimer_update_function()
The field 'function' of struct hrtimer should not be changed directly, as
the write is lockless and a concurrent timer expiry might end up using the
wrong function pointer.
Switch to use hrtimer_update_function() which also performs runtime checks
that it is safe to modify the callback.
Signed-off-by: Nam Cao <namcao@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lore.kernel.org/all/9b33f490fb1d207d3918ef5e116dc3412ae35c1e.1738746927.git.namcao@linutronix.de
---
io_uring/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index ceacf62..936f8b4 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2421,7 +2421,7 @@ static enum hrtimer_restart io_cqring_min_timer_wakeup(struct hrtimer *timer)
goto out_wake;
}
- iowq->t.function = io_cqring_timer_wakeup;
+ hrtimer_update_function(&iowq->t, io_cqring_timer_wakeup);
hrtimer_set_expires(timer, iowq->timeout);
return HRTIMER_RESTART;
out_wake:
Powered by blists - more mailing lists