[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080805.013556.194909428.davem@davemloft.net>
Date: Tue, 05 Aug 2008 01:35:56 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: a.p.zijlstra@...llo.nl
Cc: torvalds@...ux-foundation.org, jeremy@...p.org, hugh@...itas.com,
mingo@...e.hu, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org, davej@...hat.com
Subject: Re: [RFC][PATCH 3/7] lockdep: re-annotate scheduler runqueues
From: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Date: Mon, 04 Aug 2008 15:03:20 +0200
> Instead of using a per-rq lock class, use the regular nesting operations.
>
> However, take extra care with double_lock_balance() as it can release the
> already held rq->lock (and therefore change its nesting class).
>
> So what can happen is:
>
> spin_lock(rq->lock); // this rq subclass 0
>
> double_lock_balance(rq, other_rq);
> // release rq
> // acquire other_rq->lock subclass 0
> // acquire rq->lock subclass 1
>
> spin_unlock(other_rq->lock);
>
> leaving you with rq->lock in subclass 1
>
> So a subsequent double_lock_balance() call can try to nest a subclass 1
> lock while already holding a subclass 1 lock.
>
> Fix this by introducing double_unlock_balance() which releases the other
> rq's lock, but also re-sets the subclass for this rq's lock to 0.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Acked-by: David S. Miller <davem@...emloft.net>
I also tested this on 64-cpu and 128-cpu systems.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists