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

From: Bart Van Assche
Date: Wed Feb 13 2019 - 17:32:29 EST


On Fri, 2019-02-08 at 11:43 +-0000, Will Deacon wrote:
+AD4 I've also been trying to understand why it's necessary to check both of the
+AD4 pending+AF8-free entries, and I'm still struggling somewhat. It's true that the
+AD4 wakeup in get+AF8-pending+AF8-free+AF8-lock() could lead to both entries being used
+AD4 without the RCU call back running in between, however in this scenario then
+AD4 any list entries marked for freeing in the first pf will have been unhashed
+AD4 and therefore made unreachable to look+AF8-up+AF8-lock+AF8-class().
+AD4
+AD4 So I think the concern remains that entries are somehow remaining visible
+AD4 after being zapped.
+AD4
+AD4 You mentioned earlier in the thread that people actually complained about
+AD4 list corruption if you only checked the current pf:
+AD4
+AD4 +AHw The list+AF8-del+AF8-rcu() call must only happen once. I ran into complaints
+AD4 +AHw reporting that the list+AF8-del+AF8-rcu() call triggered list corruption. This
+AD4 +AHw change made these complaints disappear.
+AD4
+AD4 Do you have any more details about these complaints (e.g. kernel logs etc)?
+AD4 Failing that, any idea how to reproduce them?

Hi Will,

Since elements of the list+AF8-entries+AFsAXQ array are always accessed with the graph
lock held, how about removing the list+AF8-entries+AF8-being+AF8-freed bitmap and making
zap+AF8-class() clear the appropriate bits in the list+AF8-entries+AF8-in+AF8-use bitmap?

Thanks,

Bart.