[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87y0yjm4hi.ffs@tglx>
Date: Thu, 06 Feb 2025 17:18:17 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Jens Axboe <axboe@...nel.dk>, Nam Cao <namcao@...utronix.de>, Anna-Maria
Behnsen <anna-maria@...utronix.de>, Frederic Weisbecker
<frederic@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 05/12] io_uring: Use helper function
hrtimer_update_function()
On Wed, Feb 05 2025 at 11:45, Jens Axboe wrote:
> On 2/5/25 3:55 AM, Nam Cao wrote:
>> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
>> index ceacf6230e34..936f8b4106cf 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:
>
> The timer is known expired here, it's inside the callback. Is this
> really necessary or useful?
It's not strictly required here, but in the end this allows to make the
.function member private, which prevents stupid code fiddling with it
without proper sanity checks in the debug case.
Thanks,
tglx
Powered by blists - more mailing lists