mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: FUJITA Tomonori <tomo@flapping.org>,
	a.hindborg@kernel.org, anna-maria@linutronix.de,
	frederic@kernel.org, gary@garyguo.net, ojeda@kernel.org
Cc: acourbot@nvidia.com, aliceryhl@google.com,
	bjorn3_gh@protonmail.com, boqun@kernel.org, dakr@kernel.org,
	daniel.almeida@collabora.com, jstultz@google.com,
	lossin@kernel.org, lyude@redhat.com, sboyd@kernel.org,
	tamird@kernel.org, tmgross@umich.edu, work@onurozkan.dev,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	FUJITA Tomonori <fujita.tomonori@gmail.com>
Subject: Re: [PATCH v1 1/2] hrtimer: Add hrtimer_forward_safe_from_callback()
Date: Mon, 09 Nov 2026 22:11:43 +0100	[thread overview]
Message-ID: <871p8tvhf4.ffs@fw13> (raw)
In-Reply-To: <20261101232829.593680-2-tomo@flapping.org>

On Mon, Nov 02 2026 at 08:28, FUJITA Tomonori wrote:
> From: FUJITA Tomonori <fujita.tomonori@gmail.com>
>
> A hrtimer can be started while its callback runs. hrtimer_forward()
> writes the expiry without the base lock, so the caller has to serialize
> it against a concurrent hrtimer_start(). Otherwise the write can change
> the sort key of a queued timer.
>
> Add a variant which does the check and the update with the base lock
> held. If the timer is already queued, the expiry is left alone and the
> expiry set by hrtimer_start() wins.
>
> The first user is the Rust hrtimer abstraction. Safe Rust code can
> start a timer while its callback runs, so forward() in the callback
> can only be a safe API if the core handles a concurrent start.
>
> Suggested-by: Thomas Gleixner <tglx@kernel.org>
> Link: https://lore.kernel.org/all/877bk3ixp5.ffs@fw13/
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

I don't have anything conflicting at the moment, so this can go through
the rust tree.

Reviewed-by: Thomas Gleixner <tglx@kernel.org>

  reply	other threads:[~2026-11-09 21:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 23:28 [PATCH v1 0/2] " FUJITA Tomonori
2026-11-01 23:28 ` [PATCH v1 1/2] " FUJITA Tomonori
2026-11-09 21:11   ` Thomas Gleixner [this message]
2026-11-01 23:28 ` [PATCH v1 2/2] rust: hrtimer: Use hrtimer_forward_safe_from_callback() FUJITA Tomonori
2026-11-02 14:31   ` Andreas Hindborg
2026-11-03  2:17     ` FUJITA Tomonori
2026-11-03  9:35       ` Andreas Hindborg

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=871p8tvhf4.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=anna-maria@linutronix.de \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=frederic@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=lyude@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=tomo@flapping.org \
    --cc=work@onurozkan.dev \
    /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

all inboxes | Powered by JetHome®