Re: About a shortcoming of the verbs API

Roland Dreier
2010-07-28T17:42:32Z

> - Some time ago I observed that the kernel reported soft lockups
> because of spin_lock() calls inside a completion handler. These
> spinlocks were not locked in any other context than the completion
> handler itself. And the lockups disappeared after having replaced the
> spin_lock() calls by spin_lock_irqsave(). Can it be concluded from
> this observation that completion handlers are not always invoked from
> interrupt context ?

Did you get a soft lockup report or a lockdep report? Anyway, the very
next paragraph of the documentation I quoted says:

The context in which completion event and asynchronous event
callbacks run is not defined. Depending on the low-level driver, it
may be process context, softirq context, or interrupt context.
Upper level protocol consumers may not sleep in a callback.

So yes, it is possible that a completion callback gets called in
non-interrupt context.

However as far as I know, at least mthca and mlx4 only call completion
callbacks from the interrupt handler. But without the actual code in
question it's hard to know what the real problem was.

- R.
--
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to: