mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Avi Weiss <thnkslprpt@gmail.com>
To: jstultz@google.com, tglx@kernel.org
Cc: sboyd@kernel.org, mlichvar@redhat.com, frederic@kernel.org,
	linux-kernel@vger.kernel.org, Avi Weiss <thnkslprpt@gmail.com>
Subject: [PATCH] alarmtimer: Trace the requested expiry when starting an alarm
Date: Sun,  1 Nov 2026 21:24:02 +0200	[thread overview]
Message-ID: <20261101192401.858702-2-thnkslprpt@gmail.com> (raw)

alarm_start_timer() traces alarm->node.expires before updating it,
so alarmtimer_start reports the previous deadline on rearm.

Move the tracepoint after assigning the new expiry.

Fixes: 183d00b72713 ("alarmtimer: Provide alarm_start_timer()")
Signed-off-by: Avi Weiss <thnkslprpt@gmail.com>
---
 kernel/time/alarmtimer.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index ea5be5870e515..f6d2183aa4e3c 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -351,10 +351,9 @@ bool alarm_start_timer(struct alarm *alarm, ktime_t expires, bool relative)
 	if (relative)
 		expires = ktime_add_safe(expires, base->get_ktime());
 
-	trace_alarmtimer_start(alarm, base->get_ktime());
-
 	guard(spinlock_irqsave)(&base->lock);
 	alarm->node.expires = expires;
+	trace_alarmtimer_start(alarm, base->get_ktime());
 	alarmtimer_enqueue(base, alarm);
 	if (!hrtimer_start_range_ns_user(&alarm->timer, expires, 0, HRTIMER_MODE_ABS)) {
 		alarmtimer_dequeue(base, alarm);

base-commit: cbbddb6b08cc9900a87cccaa9b22bbe06aa4f50a
-- 
2.43.0


                 reply	other threads:[~2026-11-01 19:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261101192401.858702-2-thnkslprpt@gmail.com \
    --to=thnkslprpt@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlichvar@redhat.com \
    --cc=sboyd@kernel.org \
    --cc=tglx@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

all inboxes | Powered by JetHome®