public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Nam Cao <namcao@linutronix.de>,
	Anna-Maria Behnsen <anna-maria@linutronix.de>,
	Frederic Weisbecker <frederic@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Miguel Ojeda <ojeda@kernel.org>, Kees Cook <kees@kernel.org>,
	linux-kernel@vger.kernel.org
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	intel-gfx@lists.freedesktop.org,
	Sean Christopherson <seanjc@google.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	x86@kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Kalle Valo <kvalo@kernel.org>,
	Christian Brauner <brauner@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	John Stultz <jstultz@google.com>,
	Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [RESEND PATCH v2 05/19] io_uring: Remove redundant hrtimer's callback function setup
Date: Thu, 31 Oct 2024 09:21:43 -0600	[thread overview]
Message-ID: <878a0ef4-2870-49a8-83dd-ede33b513c40@kernel.dk> (raw)
In-Reply-To: <07b28dfd5691478a2d250f379c8b90dd37f9bb9a.1730386209.git.namcao@linutronix.de>

On 10/31/24 9:14 AM, Nam Cao wrote:
> The IORING_OP_TIMEOUT command uses hrtimer underneath. The timer's callback
> function is setup in io_timeout(), and then the callback function is setup
> again when the timer is rearmed.
> 
> Since the callback function is the same for both cases, the latter setup is
> redundant, therefore remove it.
> 
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> Cc: Jens Axboe <axboe@kernel.dk>
> ---
>  io_uring/timeout.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/io_uring/timeout.c b/io_uring/timeout.c
> index 9973876d91b0..2ffe5e1dc68a 100644
> --- a/io_uring/timeout.c
> +++ b/io_uring/timeout.c
> @@ -76,7 +76,6 @@ static void io_timeout_complete(struct io_kiocb *req, struct io_tw_state *ts)
>  			/* re-arm timer */
>  			spin_lock_irq(&ctx->timeout_lock);
>  			list_add(&timeout->list, ctx->timeout_list.prev);
> -			data->timer.function = io_timeout_fn;
>  			hrtimer_start(&data->timer, timespec64_to_ktime(data->ts), data->mode);
>  			spin_unlock_irq(&ctx->timeout_lock);
>  			return;

Should be fine, io_timeout_complete() is only used for non-linked
timeouts.

Reviewed-by: Jens Axboe <axboe@kernel.dk:

-- 
Jens Axboe

  reply	other threads:[~2024-10-31 15:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 15:14 [RESEND PATCH v2 00/19] hrtimers: Consolidate hrtimer initialization - Part 1 Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 01/19] hrtimers: Add missing hrtimer_init() trace points Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 02/19] drm/i915/request: Remove unnecessary modification of hrtimer::function Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 03/19] KVM: x86/xen: Initialize hrtimer in kvm_xen_init_vcpu() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 04/19] wifi: rt2x00: Remove redundant hrtimer_init() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 05/19] io_uring: Remove redundant hrtimer's callback function setup Nam Cao
2024-10-31 15:21   ` Jens Axboe [this message]
2024-10-31 15:14 ` [RESEND PATCH v2 06/19] hrtimers: Introduce hrtimer_setup() to replace hrtimer_init() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 07/19] hrtimers: Introduce hrtimer_setup_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 08/19] hrtimers: Introduce hrtimer_setup_sleeper_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 09/19] hrtimers: Introduce hrtimer_update_function() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 10/19] fs/aio: Switch to use hrtimer_setup_sleeper_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 11/19] futex: " Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 12/19] net: pktgen: " Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 13/19] timers: " Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 14/19] wait: " Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 15/19] hrtimers: Delete hrtimer_init_sleeper_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 16/19] sched/idle: Switch to use hrtimer_setup_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 17/19] io_uring: " Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 18/19] alarmtimer: Switch to use hrtimer_setup() and hrtimer_setup_on_stack() Nam Cao
2024-10-31 15:14 ` [RESEND PATCH v2 19/19] hrtimers: Delete hrtimer_init_on_stack() Nam Cao
2024-11-04 10:56 ` ✗ Fi.CI.BUILD: failure for hrtimers: Consolidate hrtimer initialization - Part 1 (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878a0ef4-2870-49a8-83dd-ede33b513c40@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=anna-maria@linutronix.de \
    --cc=brauner@kernel.org \
    --cc=frederic@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jstultz@google.com \
    --cc=kees@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namcao@linutronix.de \
    --cc=ojeda@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=socketcan@hartkopp.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox