Re: [PATCH v6 00/16] locking/lockdep: Add support for dynamic keys

From: Bart Van Assche
Date: Fri Jan 11 2019 - 10:55:08 EST


On Fri, 2019-01-11 at 13:48 +-0100, Peter Zijlstra wrote:
+AD4 I spotted this new v6 in my inbox and have rebased to it.

Thanks+ACE

+AD4 On Wed, Jan 09, 2019 at 01:01:48PM -0800, Bart Van Assche wrote:
+AD4
+AD4 +AD4 The changes compared to v5 are:
+AD4 +AD4 - Modified zap+AF8-class() such that it doesn't try to free a list entry that
+AD4 +AD4 is already being freed.
+AD4
+AD4 I however have a question on this+ADs this seems wrong. Once a list entry
+AD4 is enqueued it should not be reachable anymore. If we can reach an entry
+AD4 after call+AF8-rcu() happened, we've got a problem.

Apparently I confused you - sorry that I was not more clear. What I meant is
that I changed a single if test into a loop. The graph lock is held while that
loop is being executed so the code below is serialized against the code called
from inside the RCU callback:

+AEAAQA -4574,8 +-4563,9 +AEAAQA static void zap+AF8-class(struct pending+AF8-free +ACo-pf, struct lock
+AF8-class +ACo-class)
entry +AD0 list+AF8-entries +- i+ADs
if (entry-+AD4-class +ACEAPQ class +ACYAJg entry-+AD4-links+AF8-to +ACEAPQ class)
continue+ADs
- if (+AF8AXw-test+AF8-and+AF8-set+AF8-bit(i, pf-+AD4-list+AF8-entries+AF8-being+AF8-freed))
+- if (list+AF8-entry+AF8-being+AF8-freed(i))
continue+ADs
+- set+AF8-bit(i, pf-+AD4-list+AF8-entries+AF8-being+AF8-freed)+ADs
nr+AF8-list+AF8-entries--+ADs
list+AF8-del+AF8-rcu(+ACY-entry-+AD4-entry)+ADs
+AH0

Please let me know if you need more information.

Bart.