Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-10 Thread Roman Gushchin
On Mon, Jun 10, 2019 at 04:33:44PM -0400, Johannes Weiner wrote: > On Sun, Jun 09, 2019 at 03:10:52PM +0300, Vladimir Davydov wrote: > > On Tue, Jun 04, 2019 at 07:44:45PM -0700, Roman Gushchin wrote: > > > Johannes noticed that reading the memcg kmem_cache pointer in > > > cache_from_memcg_idx() i

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-10 Thread Johannes Weiner
On Sun, Jun 09, 2019 at 03:10:52PM +0300, Vladimir Davydov wrote: > On Tue, Jun 04, 2019 at 07:44:45PM -0700, Roman Gushchin wrote: > > Johannes noticed that reading the memcg kmem_cache pointer in > > cache_from_memcg_idx() is performed using READ_ONCE() macro, > > which doesn't implement a SMP ba

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-09 Thread Vladimir Davydov
On Tue, Jun 04, 2019 at 07:44:45PM -0700, Roman Gushchin wrote: > Johannes noticed that reading the memcg kmem_cache pointer in > cache_from_memcg_idx() is performed using READ_ONCE() macro, > which doesn't implement a SMP barrier, which is required > by the logic. > > Add a proper smp_rmb() to be

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-05 Thread Shakeel Butt
On Wed, Jun 5, 2019 at 10:14 AM Roman Gushchin wrote: > > On Tue, Jun 04, 2019 at 09:35:02PM -0700, Shakeel Butt wrote: > > On Tue, Jun 4, 2019 at 7:45 PM Roman Gushchin wrote: > > > > > > Johannes noticed that reading the memcg kmem_cache pointer in > > > cache_from_memcg_idx() is performed usin

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-05 Thread Roman Gushchin
On Tue, Jun 04, 2019 at 09:35:02PM -0700, Shakeel Butt wrote: > On Tue, Jun 4, 2019 at 7:45 PM Roman Gushchin wrote: > > > > Johannes noticed that reading the memcg kmem_cache pointer in > > cache_from_memcg_idx() is performed using READ_ONCE() macro, > > which doesn't implement a SMP barrier, whi

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-05 Thread Johannes Weiner
On Tue, Jun 04, 2019 at 07:44:45PM -0700, Roman Gushchin wrote: > Johannes noticed that reading the memcg kmem_cache pointer in > cache_from_memcg_idx() is performed using READ_ONCE() macro, > which doesn't implement a SMP barrier, which is required > by the logic. > > Add a proper smp_rmb() to be

Re: [PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-04 Thread Shakeel Butt
On Tue, Jun 4, 2019 at 7:45 PM Roman Gushchin wrote: > > Johannes noticed that reading the memcg kmem_cache pointer in > cache_from_memcg_idx() is performed using READ_ONCE() macro, > which doesn't implement a SMP barrier, which is required > by the logic. > > Add a proper smp_rmb() to be paired w

[PATCH v6 01/10] mm: add missing smp read barrier on getting memcg kmem_cache pointer

2019-06-04 Thread Roman Gushchin
Johannes noticed that reading the memcg kmem_cache pointer in cache_from_memcg_idx() is performed using READ_ONCE() macro, which doesn't implement a SMP barrier, which is required by the logic. Add a proper smp_rmb() to be paired with smp_wmb() in memcg_create_kmem_cache(). The same applies to me