Re: locking hierarchy based on lockdep
From: Ingo Molnar
Date: Fri Nov 10 2006 - 04:28:40 EST
* Jason Baron <jbaron@xxxxxxxxxx> wrote:
> > but ... the locks_after list should really only include locks that
> > are taken immediately after. I.e. there should only be 'distance 1'
> > locks.
>
> hmmm...that's not how i read the lockdep code...and the little piece
> of code that i added to add a distance measurement to links, found
> mostly distance 1 links but there were a number of 2 and 3 links as
> well (i don't think i saw any greater than 3).
hm, indeed, the current code does this. In theory we should not need to
add every lock to every held lock's dependency, because all the
dependency-conflict discovery algorithms can walk the full graph. The
"necessary minimum" would be to only add it to the previous non-trylock
held lock's dependency list.
ok, i like your latest patch as-is - it's simpler than to complicate the
current dependency logic. the 'distance' field is only added to the list
entry structure, so while it increases that structure's size, it at
least doesnt directly increase lock sizes.
Acked-by: Ingo Molnar <mingo@xxxxxxx>
Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/