Re: [PATCH v12 06/14] unwind_user/deferred: Add deferred unwinding interface

From
Peter Zijlstra <peterz@infradead.org>
Date
2025-07-02 16:36:22
Also in
bpf, lkml
Reply to
Steven Rostedt, 2025-07-01
On Mon, Jun 30, 2025 at 08:53:27PM -0400, Steven Rostedt wrote:
quoted hunk ↗ jump to hunk
+/*
+ * Read the task context timestamp, if this is the first caller then
+ * it will set the timestamp.
+ *
+ * For this to work properly, the timestamp (local_clock()) must
+ * have a resolution that will guarantee a different timestamp
+ * everytime a task makes a system call. That is, two short
+ * system calls back to back must have a different timestamp.
+ */
+static u64 get_timestamp(struct unwind_task_info *info)
+{
+	lockdep_assert_irqs_disabled();
+
+	if (!info->timestamp)
+		info->timestamp = local_clock();
+
+	return info->timestamp;
+}
I'm very hesitant about this. Modern hardware can do this, but older
hardware (think Intel Core and AMD Bulldozer etc hardware) might
struggle with this. They don't have stable TSC and as such will use the
magic in kernel/sched/clock.c; which can get stuck on a window edge for
a little bit and re-use timestamps.

Thread (51 messages) 51 messages, 6 authors, last reply 2025-07-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help