Skip to content

Commit fada94e

Browse files
Li Zhonghtejun
authored andcommitted
workqueue: add args to workqueue lockdep name
Tommi noticed a 'funny' lock class name: "%s#5" from a lock acquired in process_one_work(). Maybe #fmt plus #args could be used as the lock_name to give some more information for some fmt string like the above. __builtin_constant_p() check is removed (as there seems no good way to check all the variables in args list). However, by removing the check, it only adds two additional "s for those constants. Some lockdep name examples printed out after the change: lockdep name wq->name "events_long" events_long "%s"("khelper") khelper "xfs-data/%s"mp->m_fsname xfs-data/dm-3 Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 38dbfb5 commit fada94e

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎include/linux/workqueue.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,10 +419,7 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
419419
static struct lock_class_key __key; \
420420
const char *__lock_name; \
421421
\
422-
if (__builtin_constant_p(fmt)) \
423-
__lock_name = (fmt); \
424-
else \
425-
__lock_name = #fmt; \
422+
__lock_name = #fmt#args; \
426423
\
427424
__alloc_workqueue_key((fmt), (flags), (max_active), \
428425
&__key, __lock_name, ##args); \

0 commit comments

Comments
 (0)