Re: [PATCH v6] taskstats: fix data-race

2019-10-23 Thread Christian Brauner
On Wed, Oct 23, 2019 at 02:39:55PM +0200, Dmitry Vyukov wrote: > On Wed, Oct 23, 2019 at 2:16 PM Andrea Parri wrote: > > > > On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > > > When assiging and testing taskstats in taskstats_exit() there's a race > > > when writing and readin

Re: [PATCH v6] taskstats: fix data-race

2019-10-23 Thread Dmitry Vyukov
On Wed, Oct 23, 2019 at 3:11 PM Christian Brauner wrote: > > On Wed, Oct 23, 2019 at 02:39:55PM +0200, Dmitry Vyukov wrote: > > On Wed, Oct 23, 2019 at 2:16 PM Andrea Parri wrote: > > > > > > On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > > > > When assiging and testing task

Re: [PATCH v6] taskstats: fix data-race

2019-10-23 Thread Dmitry Vyukov
On Wed, Oct 23, 2019 at 2:16 PM Andrea Parri wrote: > > On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > > When assiging and testing taskstats in taskstats_exit() there's a race > > when writing and reading sig->stats when a thread-group with more than > > one thread exits: > >

Re: [PATCH v6] taskstats: fix data-race

2019-10-23 Thread Andrea Parri
On Mon, Oct 21, 2019 at 01:33:27PM +0200, Christian Brauner wrote: > When assiging and testing taskstats in taskstats_exit() there's a race > when writing and reading sig->stats when a thread-group with more than > one thread exits: > > cpu0: > thread catches fatal signal and whole thread-group ge

Re: [PATCH v6] taskstats: fix data-race

2019-10-21 Thread Christian Brauner
On Mon, Oct 21, 2019 at 02:19:01PM +0200, Rasmus Villemoes wrote: > On 21/10/2019 13.33, Christian Brauner wrote: > > The first approach used smp_load_acquire() and smp_store_release(). > > However, after having discussed this it seems that the data dependency > > for kmem_cache_alloc() would be fi

Re: [PATCH v6] taskstats: fix data-race

2019-10-21 Thread Rasmus Villemoes
On 21/10/2019 13.33, Christian Brauner wrote: > The first approach used smp_load_acquire() and smp_store_release(). > However, after having discussed this it seems that the data dependency > for kmem_cache_alloc() would be fixed by WRITE_ONCE(). > Furthermore, the smp_load_acquire() would only mana

[PATCH v6] taskstats: fix data-race

2019-10-21 Thread Christian Brauner
When assiging and testing taskstats in taskstats_exit() there's a race when writing and reading sig->stats when a thread-group with more than one thread exits: cpu0: thread catches fatal signal and whole thread-group gets taken down do_exit() do_group_exit() taskstats_exit() taskstats_tgid_all