Thread (44 messages) 44 messages, 5 authors, 2022-01-20

Re: [PATCH v0.9.1 3/6] sched/umcg: implement UMCG syscalls

flat view

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-11-24 21:19:44
Also in: linux-mm, lkml

On Mon, Nov 22, 2021 at 01:13:24PM -0800, Peter Oskolkov wrote:
+	 * Timestamp: a 46-bit CLOCK_MONOTONIC timestamp, at 16ns resolution.
quoted hunk ↗ jump to hunk
+static int umcg_update_state(u64 __user *state_ts, u64 *expected, u64 desired,
+				bool may_fault)
+{
+	u64 curr_ts = (*expected) >> (64 - UMCG_STATE_TIMESTAMP_BITS);
+	u64 next_ts = ktime_get_ns() >> UMCG_STATE_TIMESTAMP_GRANULARITY;
I'm still very hesitant to use ktime (fear the HPET); but I suppose it
makes sense to use a time base that's accessible to userspace. Was
MONOTONIC_RAW considered?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help