Messages in this thread | | | Date | Mon, 18 Apr 2011 21:37:38 +0800 | From | Yong Zhang <> | Subject | Re: [RFC][PATCH 6/7] lockdep: Maintain rw_state entries in locklist |
| |
On Sun, Apr 17, 2011 at 11:45:11AM +0200, Peter Zijlstra wrote: > From: Gautham R Shenoy <ego@in.ibm.com> > > The dependencies are currently maintained using a structure named > locklist. For a dependency A --> B, it saves B's lock_class in an > entry that would be linked to A's locks_after list. > > However, in order to make use of the split chains introduced in the > previous patch, we need to enhance this infrastructure to save the > read/write states of A and B for each dependency such that we might > distinguish between the read and write chains. > > Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> > --- > include/linux/lockdep.h | 6 ++++++ > kernel/lockdep.c | 23 +++++++++++++++++------ > 2 files changed, 23 insertions(+), 6 deletions(-) > > @@ -1690,6 +1694,8 @@ check_prev_add(struct task_struct *curr, > if (entry->dep_class == hlock_class(next)) { > if (distance == 1) > entry->distance = 1; > + entry->this_lock_rw_state |= prev->rw_state; > + entry->dep_lock_rw_state |= next->rw_state;
If we could do this and return,
> return 2; > } > } > @@ -1697,19 +1703,24 @@ check_prev_add(struct task_struct *curr, > if (!trylock_loop && !save_trace(&trace)) > return 0; > > + list_for_each_entry(entry, &hlock_class(next)->locks_before, entry) { > + if (entry->dep_class == hlock_class(prev)) { > + entry->this_lock_rw_state |= next->rw_state; > + entry->dep_lock_rw_state |= prev->rw_state; > + } > + } > +
Do we have any change to do above?
Or am I missing something?
Thanks, Yong
| |