Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCH 6/6] procfs: Kill the bkl in ioctl | Date | Thu, 1 Apr 2010 13:37:57 +0200 |
| |
On Wednesday 31 March 2010, Frederic Weisbecker wrote: > This is a solution that has been tried more than once already. But Linus > has told he wouldn't pull something that turns the bkl into a mutex or a > semaphore.
Ok. Starting from the same observation of simplicity in the remaining code, we should also be able to find a semi-automatic way of turning the BKL usage in these drivers into a per-module mutex.
> Plus it's quite hard to tell that it does or not auto-release somewhere > This is often something you can really spot on runtime or on small path > only.
Well, the autorelease by itself is not needed anywhere. What is needed is the consequence of autorelease avoiding AB-BA type deadlocks.
> The simple fact the bkl is not always a leaf lock makes it need the > auto-release, otherwise you experience very bad unexpected lock > dependencies.
I'm arguing that we can probably show the BKL to be the outermost lock for the majority of the remaining drivers, which only get it from their open(), ioctl() or llseek() functions, which are all called without any locks held. If the BKL is a regular mutex, lockdep should warn of the other cases.
Arnd
| |