Re: [PATCH 1/2] locking/lockdep: Add support for dynamic depmaps and keys

From: Bart Van Assche
Date: Mon Nov 19 2018 - 16:55:12 EST


On Sat, 2018-11-10 at 14:55 +-0100, Peter Zijlstra wrote:
+AD4 On Fri, Nov 09, 2018 at 03:46:44PM -0800, Bart Van Assche wrote:
+AD4 +AD4 The lock validator forces to categorize multiple instances of a lock object
+AD4 +AD4 as the same lock class because it requires that struct lockdep+AF8-map and struct
+AD4 +AD4 lock+AF8-class+AF8-key instances are static objects. This can result in false
+AD4 +AD4 positive lockdep reports that are hard to suppress in an elegant way. Hence
+AD4 +AD4 add support for allocating instances of these objects dynamically.
+AD4
+AD4 Yeah, I think not. You completely fail to explain how what you propose
+AD4 is correct.
+AD4
+AD4 The thing is+ADs we rely on static objects because they provide
+AD4 persistence. Their address will never be re-used.
+AD4
+AD4 Dynamic objects do not provide this same guarantee. And when you re-use
+AD4 the key address for something else, you'll mix the chains and things
+AD4 come unstuck.

Hi Peter,

Thanks for having taken a look. I will rework this patch taking your feedback
into account and will post the new version when it's ready.

Bart.