+3
−0
arch/arm/include/asm/sched_clock.h
0 → 100644
+118
−0
+1
−0
arch/arm/kernel/sched_clock.c
0 → 100644
+69
−0
Loading
Gitlab 现已全面支持 git over ssh 与 git over https。通过 HTTPS 访问请配置带有 read_repository / write_repository 权限的 Personal access token。通过 SSH 端口访问请使用 22 端口或 13389 端口。如果使用CAS注册了账户但不知道密码,可以自行至设置中更改;如有其他问题,请发邮件至 service@cra.moe 寻求协助。
Provide common sched_clock() infrastructure for platforms to use to create a 64-bit ns based sched_clock() implementation from a counter running at a non-variable clock rate. This implementation is based upon maintaining an epoch for the counter and an epoch for the nanosecond time. When we desire a sched_clock() time, we calculate the number of counter ticks since the last epoch update, convert this to nanoseconds and add to the epoch nanoseconds. We regularly refresh these epochs within the counter wrap interval. We perform a similar calculation as above, and store the new epochs. We read and write the epochs in such a way that sched_clock() can easily (and locklessly) detect when an update is in progress, and repeat the loading of these constants when they're known not to be stable. The one caveat is that sched_clock() is not called in the middle of an update. We achieve that by disabling IRQs. Finally, if the clock rate is known at compile time, the counter to ns conversion factors can be specified, allowing sched_clock() to be tightly optimized. We ensure that these factors are correct by providing an initialization function which performs a run-time check. Acked-by:Peter Zijlstra <peterz@infradead.org> Tested-by:
Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by:
Will Deacon <will.deacon@arm.com> Tested-by:
Mikael Pettersson <mikpe@it.uu.se> Tested-by:
Eric Miao <eric.y.miao@gmail.com> Tested-by:
Olof Johansson <olof@lixom.net> Tested-by:
Jamie Iles <jamie@jamieiles.com> Reviewed-by:
Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by:
Russell King <rmk+kernel@arm.linux.org.uk>
CRA Git | Maintained and supported by SUSTech CRA and CCSE