Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-16 Thread Marek Olšák
Thanks for a lot of info. The more I think about spinlocks, the more I see they don't really give as much as I thought. I was just trying to optimize some code in a wrong way and probably at a wrong place too. It doesn't even deserve a comment as it was quite a banal thing. FYI, I am not going to

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Keith Whitwell
On Wed, 2010-12-15 at 09:19 -0800, Kristian Høgsberg wrote: > On Wed, Dec 15, 2010 at 10:10 AM, Thomas Hellstrom > wrote: > ... > > Given this, I would advise strongly against building spinlocks into any code > > that might be run on a uni-processor system. Particularly gallium utility > > code.

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Kristian Høgsberg
On Wed, Dec 15, 2010 at 10:10 AM, Thomas Hellstrom wrote: ... > Given this, I would advise strongly against building spinlocks into any code > that might be run on a uni-processor system.  Particularly gallium utility > code. > If we want to get rid of unnecessary locking overhead we should probab

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Thomas Hellstrom
OK, Some info to back this up, please see inline. On 12/15/2010 01:20 PM, Thomas Hellstrom wrote: On 12/15/2010 09:23 AM, Marek Olšák wrote: On Tue, Dec 14, 2010 at 8:10 PM, Thomas Hellstrom mailto:thellst...@vmware.com>> wrote: Hmm, for the uninformed, where do we need to use spinlo

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Thomas Hellstrom
On 12/15/2010 09:23 AM, Marek Olšák wrote: On Tue, Dec 14, 2010 at 8:10 PM, Thomas Hellstrom mailto:thellst...@vmware.com>> wrote: Hmm, for the uninformed, where do we need to use spinlocks in gallium and how do we avoid using them on an UP system? I plan to use spinlocks to

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Patrick Baggett
UP = Uniprocessor system, (S)MP = (Symmetric) multiprocessor system. On Wed, Dec 15, 2010 at 2:23 AM, Marek Olšák wrote: > On Tue, Dec 14, 2010 at 8:10 PM, Thomas Hellstrom > wrote: > >> Hmm, >> >> for the uninformed, where do we need to use spinlocks in gallium and how >> do >> we avoid using

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-15 Thread Marek Olšák
On Tue, Dec 14, 2010 at 8:10 PM, Thomas Hellstrom wrote: > Hmm, > > for the uninformed, where do we need to use spinlocks in gallium and how do > we avoid using them on an UP system? > I plan to use spinlocks to guard very simple code like the macro remove_from_list, which might be, under some ci

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-14 Thread Thomas Hellstrom
Hmm, for the uninformed, where do we need to use spinlocks in gallium and how do we avoid using them on an UP system? /Thomas On 12/14/2010 02:15 PM, Marek Olšák wrote: --- src/gallium/auxiliary/os/os_thread.h | 51 ++ 1 files changed, 51 insertions(+), 0

Re: [Mesa-dev] [PATCH] os: add spinlocks

2010-12-14 Thread Keith Whitwell
Looks good to me. Keith On Tue, 2010-12-14 at 05:15 -0800, Marek Olšák wrote: > --- > src/gallium/auxiliary/os/os_thread.h | 51 > ++ > 1 files changed, 51 insertions(+), 0 deletions(-) > > diff --git a/src/gallium/auxiliary/os/os_thread.h > b/src/gallium/aux

[Mesa-dev] [PATCH] os: add spinlocks

2010-12-14 Thread Marek Olšák
--- src/gallium/auxiliary/os/os_thread.h | 51 ++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index a084310..6c25b33 100644 --- a/src/gallium/auxiliary/os/os_thread.h