Horst von Brand <[EMAIL PROTECTED]> wrote: > Lost me there. If after releasing the mutex it is free, the release was > sucessful AFAIAC. If two threads try to do it at the same time, so what? > Releasing an already free mutex is broken, OK. But two threads owning the > mutex at the same time is much worse... Because the mutex release is done in two stages: (1) clear the state bit and (2) set the owner pointer to NULL. This is a sufficient window for a potential mutex grabber to jump in grab the mutex and then have stage (2) clobber the owner pointer. Anyway, I've changed this now (though I haven't got around to testing it yet): On platforms that support cmpxchg(), it uses the owner pointer as the state and exchanges it to NULL to release the mutex, and exchanges it to the owner pointer when grabbing. On platforms that don't, a spinlock is added to the WineMutex structure. David - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] Please read the FAQ at http://www.tux.org/lkml/
- Re: [RFC] Wine speedup through kernel mo... David Howells
- Re: [RFC] Wine speedup through kernel module David Woodhouse
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module Andi Kleen
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module Andi Kleen
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module Andi Kleen
- Re: [RFC] Wine speedup through kernel mo... David Howells
- Re: [RFC] Wine speedup through kerne... Horst von Brand
- Re: Re: [RFC] Wine speedup thro... David Howells
- Re: Re: [RFC] Wine speedup through kernel module Bernhard Bender
- Re: [RFC] Wine speedup through kernel module J. Robert von Behren
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module David Howells
- Re: [RFC] Wine speedup through kernel module Linus Torvalds
- Re: [RFC] Wine speedup through kernel module Pavel Machek
- Re: [RFC] Wine speedup & "dynamic s... David Howells