Thread (13 messages) 13 messages, 3 authors, 2026-09-01

Re: [RFC 1/3] rv: add per-edge dwell-time statistics primitive

flat view

From: Gabriele Monaco <gmonaco@redhat.com>
Date: 2026-09-01 07:37:34
Also in: linux-doc, linux-kselftest, lkml

On Thu, 2026-08-27 at 09:23 +0200, Tobias Schaffner wrote:
quoted hunk ↗ jump to hunk
+	while (dwell_ns > (u64)max) {
+		s64 prev = local64_cmpxchg(&s->max_ns, max, dwell_ns);
+
+		if (prev == max)
+			break;
+		max = prev;
+	}
try_cmpxchg() functions produce arguably cleaner code, would you mind doing:

  while (dwell_ns > (u64)max) {
      if (local64_try_cmpxchg(&s->max_ns, &max, dwell_ns))
          break;
  }

Also, although issues are practically impossible, I'd avoid an unbound loop in
hot paths, you could go up to MAX_DA_RETRY_RACING_EVENTS (already existing in
da_monitor) and put some warning in case you reach the maximum amount of
retries.

Thanks,
Gabriele
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help