Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Tejun Heo
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)

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Aleksa Sarai
On 2019-10-17, Aleksa Sarai wrote: > On 2019-10-16, Tejun Heo wrote: > > Hello, Aleksa. > > > > On Wed, Oct 16, 2019 at 07:32:19PM +1100, Aleksa Sarai wrote: > > > Maybe I'm misunderstanding Documentation/atomic_t.txt, but it looks to > > > me like it's explicitly saying that I shouldn't use

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Tejun Heo
Hello, On Thu, Oct 17, 2019 at 02:29:46AM +1100, Aleksa Sarai wrote: > > Hah, where is it saying that? > > Isn't that what this says: > > > Therefore, if you find yourself only using the Non-RMW operations of > > atomic_t, you do not in fact need atomic_t at all and are doing it > > wrong. > >

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Aleksa Sarai
On 2019-10-16, Tejun Heo wrote: > Hello, Aleksa. > > On Wed, Oct 16, 2019 at 07:32:19PM +1100, Aleksa Sarai wrote: > > Maybe I'm misunderstanding Documentation/atomic_t.txt, but it looks to > > me like it's explicitly saying that I shouldn't use atomic64_t if I'm > > just using it for fetching

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Tejun Heo
Hello, Aleksa. On Wed, Oct 16, 2019 at 07:32:19PM +1100, Aleksa Sarai wrote: > Maybe I'm misunderstanding Documentation/atomic_t.txt, but it looks to > me like it's explicitly saying that I shouldn't use atomic64_t if I'm > just using it for fetching and assignment. Hah, where is it saying that?

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-16 Thread Aleksa Sarai
On 2019-10-14, Tejun Heo wrote: > Hello, Aleksa. > > On Tue, Oct 15, 2019 at 02:59:31AM +1100, Aleksa Sarai wrote: > > On 2019-10-14, Tejun Heo wrote: > > > On Sat, Oct 12, 2019 at 12:05:39PM +1100, Aleksa Sarai wrote: > > > > Because pids->limit can be changed concurrently (but we don't want

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-14 Thread Tejun Heo
Hello, Aleksa. On Tue, Oct 15, 2019 at 02:59:31AM +1100, Aleksa Sarai wrote: > On 2019-10-14, Tejun Heo wrote: > > On Sat, Oct 12, 2019 at 12:05:39PM +1100, Aleksa Sarai wrote: > > > Because pids->limit can be changed concurrently (but we don't want to > > > take a lock because it would be

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-14 Thread Aleksa Sarai
On 2019-10-14, Tejun Heo wrote: > On Sat, Oct 12, 2019 at 12:05:39PM +1100, Aleksa Sarai wrote: > > Because pids->limit can be changed concurrently (but we don't want to > > take a lock because it would be needlessly expensive), use the > > appropriate memory barriers. > > I can't quite tell

Re: [PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-14 Thread Tejun Heo
On Sat, Oct 12, 2019 at 12:05:39PM +1100, Aleksa Sarai wrote: > Because pids->limit can be changed concurrently (but we don't want to > take a lock because it would be needlessly expensive), use the > appropriate memory barriers. I can't quite tell what problem it's fixing. Can you elaborate a

[PATCH] cgroup: pids: use {READ,WRITE}_ONCE for pids->limit operations

2019-10-11 Thread Aleksa Sarai
Because pids->limit can be changed concurrently (but we don't want to take a lock because it would be needlessly expensive), use the appropriate memory barriers. Fixes: commit 49b786ea146f ("cgroup: implement the PIDs subsystem") Cc: sta...@vger.kernel.org # v4.3+ Signed-off-by: Aleksa Sarai ---