All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] async: Use ktime_us_delta() for debug timings
@ 2026-10-27 12:01 zhoumin
  2026-10-27 13:28 ` Arjan van de Ven
  0 siblings, 1 reply; 2+ messages in thread
From: zhoumin @ 2026-10-27 12:01 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Tejun Heo, Rasmus Villemoes, Arjan van de Ven,
	teczm

Replace microseconds_since() with ktime_us_delta() for accurate
microsecond timings.

Fixes: 22a9d645677f ("async: Asynchronous function calls to speed up kernel boot")
Signed-off-by: zhoumin <teczm@foxmail.com>
---
 kernel/async.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/kernel/async.c b/kernel/async.c
index 0e3a783dc991..e8862c39344b 100644
--- a/kernel/async.c
+++ b/kernel/async.c
@@ -80,12 +80,6 @@ static DECLARE_WAIT_QUEUE_HEAD(async_done);
 
 static atomic_t entry_count;
 
-static long long microseconds_since(ktime_t start)
-{
-	ktime_t now = ktime_get();
-	return ktime_to_ns(ktime_sub(now, start)) >> 10;
-}
-
 static async_cookie_t lowest_in_progress(struct async_domain *domain)
 {
 	struct async_entry *first = NULL;
@@ -130,7 +124,7 @@ static void async_run_entry_fn(struct work_struct *work)
 
 	pr_debug("initcall %lli_%pS returned after %lld usecs\n",
 		 (long long)entry->cookie, entry->func,
-		 microseconds_since(calltime));
+		 ktime_us_delta(ktime_get(), calltime));
 
 	/* 2) remove self from the pending queues */
 	spin_lock_irqsave(&async_lock, flags);
@@ -317,7 +311,7 @@ void async_synchronize_cookie_domain(async_cookie_t cookie, struct async_domain
 	wait_event(async_done, lowest_in_progress(domain) >= cookie);
 
 	pr_debug("async_continuing @ %i after %lli usec\n", task_pid_nr(current),
-		 microseconds_since(starttime));
+		 ktime_us_delta(ktime_get(), starttime));
 }
 EXPORT_SYMBOL_GPL(async_synchronize_cookie_domain);
 

base-commit: d135ab453a7400a34930bdda1ef4bdc8acfac80e
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-27 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 12:01 [PATCH] async: Use ktime_us_delta() for debug timings zhoumin
2026-10-27 13:28 ` Arjan van de Ven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.