]> git.baikalelectronics.ru Git - kernel.git/commit
sched/vtime: Prevent unstable evaluation of WARN(vtime->state)
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 23 Jan 2020 18:08:49 +0000 (19:08 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 6 Mar 2020 11:57:16 +0000 (12:57 +0100)
commitf87c7b19b050ec063cadf92821332098dc89123c
tree37791cfddf0e1e76792321e96271bf86cbe9c5bf
parentd5a7ad770c400c332b605b89e3736c6d22dcc249
sched/vtime: Prevent unstable evaluation of WARN(vtime->state)

As the vtime is sampled under loose seqcount protection by kcpustat, the
vtime fields may change as the code flows. Where logic dictates a field
has a static value, use a READ_ONCE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Fixes: 90797d54eed2 ("sched/vtime: Bring up complete kcpustat accessor")
Link: https://lkml.kernel.org/r/20200123180849.28486-1-frederic@kernel.org
kernel/sched/cputime.c