Messages in this thread | | | Subject | Re: [PATCH] Export current_is_keventd() for libphy | From | Roland Dreier <> | Date | Tue, 05 Dec 2006 15:52:13 -0800 |
| |
> Ah. The point is that the phy code doesn't want to flush _all_ pending > callbacks. It only wants to flush its own one. And its own one doesn't > take rtnl_lock().
OK, got it. You're absolutely correct.
> Maybe the lesson here is that flush_scheduled_work() is a bad function. > It should really be flush_this_work(struct work_struct *w). That is in > fact what approximately 100% of the flush_scheduled_work() callers actually > want to do.
I think flush_this_work() runs into trouble if it means "make sure everything up to <this work> has completed" because it still syncs with everything before <this work>, which has the same risk of deadlock. And I'm not totally sure everyone who does flush_scheduled_work() really means "cancel my work" -- they might mean "finish up my work".
For example I would have to do some archeology to remember exactly what I needed flush_scheduled_work() when I wrote drivers/infiniband/ulp/ipoib
- R. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |