sched/fair: Provide u64 read for 32-bits arch helper
authorVincent Donnefort <vincent.donnefort@arm.com>
Tue, 21 Jun 2022 09:04:08 +0000 (10:04 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 28 Jun 2022 07:17:46 +0000 (09:17 +0200)
commitd05b43059dfa115037cd37bc276a8316391def28
treeea26f09e40de853767e83d285751b900115386b6
parent70fb5ccf2ebb09a0c8ebba775041567812d45f86
sched/fair: Provide u64 read for 32-bits arch helper

Introducing macro helpers u64_u32_{store,load}() to factorize lockless
accesses to u64 variables for 32-bits architectures.

Users are for now cfs_rq.min_vruntime and sched_avg.last_update_time. To
accommodate the later where the copy lies outside of the structure
(cfs_rq.last_udpate_time_copy instead of sched_avg.last_update_time_copy),
use the _copy() version of those helpers.

Those new helpers encapsulate smp_rmb() and smp_wmb() synchronization and
therefore, have a small penalty for 32-bits machines in set_task_rq_fair()
and init_cfs_rq().

Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lkml.kernel.org/r/20220621090414.433602-2-vdonnefort@google.com
kernel/sched/fair.c
kernel/sched/sched.h