Re: [RFC tip/locking/lockdep v5 06/17] lockdep: Support deadlock detection for recursive read in check_noncircular()
From: Peter Zijlstra
Date: Thu Feb 22 2018 - 09:54:46 EST
On Thu, Feb 22, 2018 at 03:08:53PM +0800, Boqun Feng wrote:
> +static inline int hlock_conflict(struct lock_list *entry, void *data)
> +{
> + struct held_lock *hlock = (struct held_lock *)data;
> +
> + return hlock_class(hlock) == entry->class &&
> + (hlock->read != 2 || !entry->is_rr);
> +}
Bah, brain hurts.
So before we add prev -> this, relation, we check if there's a this ->
prev relation already in the graph -- if so that would be a problem.
The above function has @data == @prev (__bfs_forward starts at @this,
looking for @prev), and the above patch augments the 'class_equal' test
with @prev not having read==2 or @entry not having xr;
This is because.... (insert brain hurt)