Messages in this thread | | | Date | Fri, 7 Dec 2012 22:01:26 +0100 | From | Oleg Nesterov <> | Subject | Re: [RFC PATCH v2 01/10] CPU hotplug: Provide APIs for "light" atomic readers to prevent CPU offline |
| |
On 12/07, Srivatsa S. Bhat wrote: > > CPU 0 CPU 1 > ------ ------ > > 1. Acquire lock A Increment CPU1's > atomic counter > > > > 2. Increment CPU0's Try to acquire lock A > atomic counter > > > Now consider what happens if a hotplug writer (cpu_down) begins,
Exactly. So the fake lockdep_map should be per-cpu as well.
lglock doesn't need this because lg_local_lock() is not recursive and lockdep can catch the bug like this. So it can look as single lock for lockdep.
IOW. If you use the global lockdep_map and want lockdep to notice this deadlock you need rwlock_acquire_read(map, 0, 0, IP). But then lockdep will complain if the task does "read lock" under "read lock".
Oleg.
| |