buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 20:40, Thomas Hellstrom schreef: > On 10/15/2012 05:37 PM, Maarten Lankhorst wrote: >> Op 15-10-12 14:27, Thomas Hellstrom schreef: >>> On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrot

buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/15/2012 05:37 PM, Maarten Lankhorst wrote: > Op 15-10-12 14:27, Thomas Hellstrom schreef: >> On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: >>> Op 12-10-12 07:57, Thomas Hellstrom schreef: On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: > Op 11-10-12 21:26, Thomas Hellstrom schree

buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 17:37, Maarten Lankhorst schreef: >>> To make multi-object reservation work, the fix is to add a ticket "lock" of >>> which all the >>> reservation objects are a nested lock of. Since in this case the ticket >>> lock would prevent >>> deadlocks, this is acceptable. Having 2 ticket 'l

buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 14:27, Thomas Hellstrom schreef: > On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: >> Op 12-10-12 07:57, Thomas Hellstrom schreef: >>> On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: Op 11-10-12 21:26, Thomas Hellstrom schreef: > On 10/11/2012 08:42 PM, Maarten Lankhorst wrot

buggy/weird behavior in ttm

2012-10-15 Thread Jerome Glisse
On Mon, Oct 15, 2012 at 08:34:17PM +0200, Maarten Lankhorst wrote: > Op 15-10-12 17:37, Maarten Lankhorst schreef: > >>> To make multi-object reservation work, the fix is to add a ticket "lock" > >>> of which all the > >>> reservation objects are a nested lock of. Since in this case the ticket >

buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: > Op 12-10-12 07:57, Thomas Hellstrom schreef: >> On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: >>> Op 11-10-12 21:26, Thomas Hellstrom schreef: On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >> Anyway, if you plan to remove the fe

buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/12/2012 09:49 AM, Maarten Lankhorst wrote: > > I suppose there will stay a small race though, Hmm, where? >>> When you enter the ddestroy path, you drop the lock and hope the buffer >>> doesn't reserved >>> away from under you. >> Yes, that code isn't fully correct, it's missing a c

Re: buggy/weird behavior in ttm

2012-10-15 Thread Jerome Glisse
On Mon, Oct 15, 2012 at 08:34:17PM +0200, Maarten Lankhorst wrote: > Op 15-10-12 17:37, Maarten Lankhorst schreef: > >>> To make multi-object reservation work, the fix is to add a ticket "lock" > >>> of which all the > >>> reservation objects are a nested lock of. Since in this case the ticket >

Re: buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 20:40, Thomas Hellstrom schreef: > On 10/15/2012 05:37 PM, Maarten Lankhorst wrote: >> Op 15-10-12 14:27, Thomas Hellstrom schreef: >>> On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrot

Re: buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/15/2012 05:37 PM, Maarten Lankhorst wrote: Op 15-10-12 14:27, Thomas Hellstrom schreef: On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: Op 12-10-12 07:57, Thomas Hellstrom schreef: On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: Op 11-10-12 21:26, Thomas Hellstrom schreef: On 10/11/2

Re: buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 17:37, Maarten Lankhorst schreef: >>> To make multi-object reservation work, the fix is to add a ticket "lock" of >>> which all the >>> reservation objects are a nested lock of. Since in this case the ticket >>> lock would prevent >>> deadlocks, this is acceptable. Having 2 ticket 'l

Re: buggy/weird behavior in ttm

2012-10-15 Thread Maarten Lankhorst
Op 15-10-12 14:27, Thomas Hellstrom schreef: > On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: >> Op 12-10-12 07:57, Thomas Hellstrom schreef: >>> On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: Op 11-10-12 21:26, Thomas Hellstrom schreef: > On 10/11/2012 08:42 PM, Maarten Lankhorst wrot

Re: buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/12/2012 12:09 PM, Maarten Lankhorst wrote: Op 12-10-12 07:57, Thomas Hellstrom schreef: On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: Op 11-10-12 21:26, Thomas Hellstrom schreef: On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: Anyway, if you plan to remove the fence lock and protec

Re: buggy/weird behavior in ttm

2012-10-15 Thread Thomas Hellstrom
On 10/12/2012 09:49 AM, Maarten Lankhorst wrote: I suppose there will stay a small race though, Hmm, where? When you enter the ddestroy path, you drop the lock and hope the buffer doesn't reserved away from under you. Yes, that code isn't fully correct, it's missing a check for still on dde

buggy/weird behavior in ttm

2012-10-12 Thread Maarten Lankhorst
Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: >> Op 11-10-12 21:26, Thomas Hellstrom schreef: >>> On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >>> > Anyway, if you plan to remove the fence lock and protect it with reserve, > you must >>

buggy/weird behavior in ttm

2012-10-12 Thread Maarten Lankhorst
Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: >> Op 11-10-12 21:26, Thomas Hellstrom schreef: >>> On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >>> > Anyway, if you plan to remove the fence lock and protect it with reserve, > you must >>

buggy/weird behavior in ttm

2012-10-12 Thread Thomas Hellstrom
On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: > Op 11-10-12 21:26, Thomas Hellstrom schreef: >> On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >> Anyway, if you plan to remove the fence lock and protect it with reserve, you must make sure that a waiting reserve is never done in

Re: buggy/weird behavior in ttm

2012-10-12 Thread Maarten Lankhorst
Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: >> Op 11-10-12 21:26, Thomas Hellstrom schreef: >>> On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >>> > Anyway, if you plan to remove the fence lock and protect it with reserve, > you must >>

Re: buggy/weird behavior in ttm

2012-10-12 Thread Maarten Lankhorst
Op 12-10-12 07:57, Thomas Hellstrom schreef: > On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: >> Op 11-10-12 21:26, Thomas Hellstrom schreef: >>> On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: >>> > Anyway, if you plan to remove the fence lock and protect it with reserve, > you must >>

Re: buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 10:55 PM, Maarten Lankhorst wrote: Op 11-10-12 21:26, Thomas Hellstrom schreef: On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: Anyway, if you plan to remove the fence lock and protect it with reserve, you must make sure that a waiting reserve is never done in a destruction pat

buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
Op 11-10-12 21:26, Thomas Hellstrom schreef: > On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: > >> >>> Anyway, if you plan to remove the fence lock and protect it with reserve, >>> you must >>> make sure that a waiting reserve is never done in a destruction path. I >>> think this >>> mostly con

buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 09:26 PM, Thomas Hellstrom wrote: > On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: > I can't see how the waiting reserve in ttm_bo_cleanup_refs would cause > a deadlock, > because the buffer about to be reserved is always *last* in a > reservation sequence, and the > reservation

buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: > >> Anyway, if you plan to remove the fence lock and protect it with reserve, >> you must >> make sure that a waiting reserve is never done in a destruction path. I >> think this >> mostly concerns the nvidia driver. > Well I don't think any lock

buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
Op 11-10-12 18:57, Thomas Hellstrom schreef: > On 10/11/2012 04:50 PM, Maarten Lankhorst wrote: >> I was trying to clean ttm up a little so my changes would be less invasive, >> and simplify >> the code for debuggability. During testing I noticed the following >> weirdnesses: >> - ttm_mem_evict_f

buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 04:50 PM, Maarten Lankhorst wrote: > I was trying to clean ttm up a little so my changes would be less invasive, > and simplify > the code for debuggability. During testing I noticed the following > weirdnesses: > - ttm_mem_evict_first ignores no_wait_gpu if the buffer is on the dde

buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
I was trying to clean ttm up a little so my changes would be less invasive, and simplify the code for debuggability. During testing I noticed the following weirdnesses: - ttm_mem_evict_first ignores no_wait_gpu if the buffer is on the ddestroy list. If you follow the code, it will effectively sp

Re: buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
Op 11-10-12 21:26, Thomas Hellstrom schreef: > On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: > >> >>> Anyway, if you plan to remove the fence lock and protect it with reserve, >>> you must >>> make sure that a waiting reserve is never done in a destruction path. I >>> think this >>> mostly con

Re: buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 09:26 PM, Thomas Hellstrom wrote: On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: I can't see how the waiting reserve in ttm_bo_cleanup_refs would cause a deadlock, because the buffer about to be reserved is always *last* in a reservation sequence, and the reservation is always

Re: buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 08:42 PM, Maarten Lankhorst wrote: Anyway, if you plan to remove the fence lock and protect it with reserve, you must make sure that a waiting reserve is never done in a destruction path. I think this mostly concerns the nvidia driver. Well I don't think any lock should ever b

Re: buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
Op 11-10-12 18:57, Thomas Hellstrom schreef: > On 10/11/2012 04:50 PM, Maarten Lankhorst wrote: >> I was trying to clean ttm up a little so my changes would be less invasive, >> and simplify >> the code for debuggability. During testing I noticed the following >> weirdnesses: >> - ttm_mem_evict_f

Re: buggy/weird behavior in ttm

2012-10-11 Thread Thomas Hellstrom
On 10/11/2012 04:50 PM, Maarten Lankhorst wrote: I was trying to clean ttm up a little so my changes would be less invasive, and simplify the code for debuggability. During testing I noticed the following weirdnesses: - ttm_mem_evict_first ignores no_wait_gpu if the buffer is on the ddestroy lis

buggy/weird behavior in ttm

2012-10-11 Thread Maarten Lankhorst
I was trying to clean ttm up a little so my changes would be less invasive, and simplify the code for debuggability. During testing I noticed the following weirdnesses: - ttm_mem_evict_first ignores no_wait_gpu if the buffer is on the ddestroy list. If you follow the code, it will effectively sp