Re: workqueue, pci: INFO: possible recursive locking detected

From: Tejun Heo
Date: Tue Jul 23 2013 - 10:38:53 EST


Hey, Lai.

On Tue, Jul 23, 2013 at 09:23:14AM +0800, Lai Jiangshan wrote:
> The problem is that the userS may not know their work_on_cpu() nested,
> especially when work_on_cpu()s are on different subsystems and the call depth
> is deep enough but the nested work_on_cpu() depends on some conditions.

Yeah, that's a possibility. Not sure how much it'd actually matter
tho given that this is the only instance we have and we've had the
lockdep annotation for years.

> I prefer to change the user instead of introducing work_on_cpu_nested(), and
> I accept to change the user only instead of change work_on_cpu() since there is only
> one nested-calls case found.
>
> But I'm thinking, since nested work_on_cpu() don't have any problem,
> Why workqueue.c don't offer a more friendly API/behavior?

If we wanna solve it from workqueue side, let's please do it by
introduing an internal flush_work() variant which skips the lockdep
annotation. I'd really like to avoid using completion here. It's
nasty as it depends solely on the fact that completion doesn't have
lockdep annotation yet. Let's do it explicitly.

Thanks.

--
tejun
--
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/