Re: [PATCHv2] percpu: make this_cpu_generic_read() atomic w.r.t. interrupts

2017-09-26 Thread Tejun Heo
On Tue, Sep 26, 2017 at 12:41:52PM +0100, Mark Rutland wrote: > As raw_cpu_generic_read() is a plain read from a raw_cpu_ptr() address, > it's possible (albeit unlikely) that the compiler will split the access > across multiple instructions. > > In this_cpu_generic_read() we disable preemption but

[PATCHv2] percpu: make this_cpu_generic_read() atomic w.r.t. interrupts

2017-09-26 Thread Mark Rutland
As raw_cpu_generic_read() is a plain read from a raw_cpu_ptr() address, it's possible (albeit unlikely) that the compiler will split the access across multiple instructions. In this_cpu_generic_read() we disable preemption but not interrupts before calling raw_cpu_generic_read(). Thus, an interrup