Files
android_kernel_xiaomi_sm8450/kernel
Peter Zijlstra 7531e2f34d lockdep: lock protection locks
On Fri, 2008-08-01 at 16:26 -0700, Linus Torvalds wrote:

> On Fri, 1 Aug 2008, David Miller wrote:
> >
> > Taking more than a few locks of the same class at once is bad
> > news and it's better to find an alternative method.
>
> It's not always wrong.
>
> If you can guarantee that anybody that takes more than one lock of a
> particular class will always take a single top-level lock _first_, then
> that's all good. You can obviously screw up and take the same lock _twice_
> (which will deadlock), but at least you cannot get into ABBA situations.
>
> So maybe the right thing to do is to just teach lockdep about "lock
> protection locks". That would have solved the multi-queue issues for
> networking too - all the actual network drivers would still have taken
> just their single queue lock, but the one case that needs to take all of
> them would have taken a separate top-level lock first.
>
> Never mind that the multi-queue locks were always taken in the same order:
> it's never wrong to just have some top-level serialization, and anybody
> who needs to take <n> locks might as well do <n+1>, because they sure as
> hell aren't going to be on _any_ fastpaths.
>
> So the simplest solution really sounds like just teaching lockdep about
> that one special case. It's not "nesting" exactly, although it's obviously
> related to it.

Do as Linus suggested. The lock protection lock is called nest_lock.

Note that we still have the MAX_LOCK_DEPTH (48) limit to consider, so anything
that spills that it still up shit creek.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-08-11 09:30:24 +02:00
..
2008-07-26 12:00:07 -07:00
2008-07-28 23:32:00 +02:00
2008-07-23 17:47:32 -07:00
2008-05-01 08:03:59 -07:00
2008-07-28 23:32:00 +02:00
2008-07-25 10:53:38 -07:00
2008-07-26 20:53:20 -04:00
2008-07-28 16:30:21 -07:00
2008-03-30 14:18:41 -07:00
2008-07-26 12:00:04 -07:00
2007-07-16 09:05:50 -07:00
2008-06-24 10:52:55 -05:00
2008-07-26 12:00:09 -07:00
2008-08-11 09:30:24 +02:00
2008-07-02 15:06:24 -06:00
2008-07-25 10:53:29 -07:00
2008-07-26 12:00:09 -07:00
2007-07-16 09:05:50 -07:00
2008-07-26 12:00:09 -07:00
2008-05-23 20:39:40 +02:00
2008-02-06 10:41:02 -08:00
2008-07-26 12:00:04 -07:00
2008-07-25 10:53:45 -07:00
2008-07-27 09:45:34 -07:00
2008-04-30 08:29:53 -07:00
2008-02-08 09:22:31 -08:00
2008-08-11 09:30:23 +02:00