Re: [PATCH] tick/sched: fix data races at tick_do_timer_cpu

From: Thomas Gleixner
Date: Wed Mar 04 2020 - 04:39:50 EST


Qian,

Qian Cai <cai@xxxxxx> writes:
> tick_do_timer_cpu could be accessed concurrently where both plain writes
> and plain reads are not protected by a lock. Thus, it could result in
> data races. Fix them by adding pairs of READ|WRITE_ONCE(). The data
> races were reported by KCSAN,

They are reported, but are they actually a real problem?

This completely lacks analysis why these 8 places need the
READ/WRITE_ONCE() treatment at all and if so why the other 14 places
accessing tick_do_timer_cpu are safe without it.

I definitely appreciate the work done with KCSAN, but just making the
tool shut up does not cut it.

Thanks,

tglx