Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-18 Thread Tvrtko Ursulin
On 07/18/2014 10:20 AM, Gore, Tim wrote: Unfortunately Android threads do not support cancel and testcancel, so this Test cannot build for android. Do we really need a cancellation point, since we don't need to cancel the thread. Tvrtko's original solution seemed workable, if a bit less polishe

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-18 Thread Gore, Tim
ginal Message- > From: Intel-gfx [mailto:intel-gfx-boun...@lists.freedesktop.org] On Behalf > Of Chris Wilson > Sent: Monday, July 14, 2014 2:28 PM > To: Tvrtko Ursulin > Cc: Intel-gfx@lists.freedesktop.org > Subject: Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between >

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Chris Wilson
On Mon, Jul 14, 2014 at 02:13:22PM +0100, Tvrtko Ursulin wrote: > On 07/14/2014 02:07 PM, Chris Wilson wrote: > >>>You don't have any cancellation points in the loop. (mmap may or may not > >>>be, it is not required to be.) > >>> > >>>But rather than use a global, just pass a pointer to a local str

[Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Userptr v23 was not thread safe against memory map operations and object creation from separate threads. MMU notifier callback would get triggered on a partially constructed object causing a NULL pointer dereference. This test excercises that path a bit. In my testing it wou

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Tvrtko Ursulin
On 07/14/2014 02:07 PM, Chris Wilson wrote: You don't have any cancellation points in the loop. (mmap may or may not be, it is not required to be.) But rather than use a global, just pass a pointer to a local struct. It doesn't need both a cancellation point and a flag. Should I just add pthre

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Chris Wilson
> >You don't have any cancellation points in the loop. (mmap may or may not > >be, it is not required to be.) > > > >But rather than use a global, just pass a pointer to a local struct. > > It doesn't need both a cancellation point and a flag. Should I just > add pthread_testcancel in the loop and

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Tvrtko Ursulin
On 07/14/2014 11:34 AM, Chris Wilson wrote: On Mon, Jul 14, 2014 at 11:03:26AM +0100, Tvrtko Ursulin wrote: From: Tvrtko Ursulin Userptr v23 was not thread safe against memory map operations and object creation from separate threads. MMU notifier callback would get triggered on a partially co

Re: [Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Chris Wilson
On Mon, Jul 14, 2014 at 11:03:26AM +0100, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > Userptr v23 was not thread safe against memory map operations and object > creation from separate threads. MMU notifier callback would get triggered > on a partially constructed object causing a NULL pointe

[Intel-gfx] [PATCH] tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

2014-07-14 Thread Tvrtko Ursulin
From: Tvrtko Ursulin Userptr v23 was not thread safe against memory map operations and object creation from separate threads. MMU notifier callback would get triggered on a partially constructed object causing a NULL pointer dereference. This test excercises that path a bit. In my testing it wou