Re: [PATCH 2/2] workqueue: debug work related deadlocks with lockdep

From: Oleg Nesterov
Date: Thu Jul 05 2007 - 11:35:42 EST


On 07/05, Johannes Berg wrote:
>
> +#define __WORK_INIT_LOCKDEP_MAP(n, k) \
> + .lockdep_map = STATIC_LOCKDEP_MAP_INIT(n, k),
> +#else
> +#define __WORK_INIT_LOCKDEP_MAP(n, k)
> +#endif
> +
> #define __WORK_INITIALIZER(n, f) { \
> .data = WORK_DATA_INIT(), \
> .entry = { &(n).entry, &(n).entry }, \
> .func = (f), \
> + __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \

[...snip...]

> +#define STATIC_LOCKDEP_MAP_INIT(_name, _key) \
> + { .name = (_name), .key = (void *)(_key), }

Hmm... Can't understand, please help!

So, __WORK_INITIALIZER() uses work_struct itself as a "struct lock_class_key" ?
How so?

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/