Re: lockdep: strange %s#5 lock name

Tejun Heo <[email protected]>
Newsgroups org.kernel.vger.trinity,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Mon, Feb 10, 2014 at 08:28:46PM +0100, Peter Zijlstra wrote:
> Lol.. its correct afaict:
> 
> struct workqueue_struct *__alloc_workqueue_key(const char *fmt,
> 					       unsigned int flags,
> 					       int max_active,
> 					       struct lock_class_key *key,
> 					       const char *lock_name, ...)
> {
> 	...
> 	lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
> 
> 
> 
> So while its called lock_name, it looks like the argument is a format.

Heh, yeah, that's silly.

> I suppose the below was what was intended...
> 
> ---
>  kernel/workqueue.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 82ef9f3b7473..861d8ddd92a2 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -4202,7 +4202,7 @@ struct workqueue_struct *__alloc_workqueue_key(const char *fmt,
>  	INIT_LIST_HEAD(&wq->flusher_overflow);
>  	INIT_LIST_HEAD(&wq->maydays);
>  
> -	lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
> +	lockdep_init_map(&wq->lockdep_map, wq->name, key, 0);

Looks good to me.  Can you please post the patch with SOB?

Thanks!

-- 
tejun
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.