Messages in this thread | | | Date | Wed, 16 Oct 2019 08:54:07 -0700 | From | Tejun Heo <> | Subject | Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations |
| |
On Thu, Oct 17, 2019 at 02:35:20AM +1100, Aleksa Sarai wrote: > > Sure, I will switch it to use atomic64_read() and atomic64_set() instead > > if that's what you'd prefer. Though I will mention that on quite a few > > architectures atomic64_read() is defined as: > > > > #define atomic64_read(v) READ_ONCE((v)->counter) > > Though I guess that's because on those architectures it turns out that > READ_ONCE is properly atomic?
Oh yeah, on archs where 64bit accesses are atomic, READ_ONCE() / WRITE_ONCE() would work here. If the limit variable were ulong instead of an explicit 64bit variable, RW ONCE would work too as ulong accesses are atomic on all archs IIRC.
Thanks.
-- tejun
| |