On Fri, May 19, 2017 at 11:47 AM, Akshay Narayan <aksh...@mit.edu> wrote: >> I don't want to defend the use of yield() but it looks like there is other >> problem. > > I believe this use of yield() should be replaced with cond_resched() > even if it turns out there is an unrelated problem.
Yeah, it is a different problem, because cond_resched() itself could sleep too so it doesn't fix the schedule-in-atomic problem, not to mention the kmalloc() would sleep. > >> Does this module call netlink_broadcast() with __GFP_DIRECT_RECLAIM >> in IRQ context? If so you should adjust the gfp flags. > > The module only calls netlink_broadcast() from a pluggable TCP > function; from my understanding this is not in the IRQ context. Full > trace, perhaps more clear, attached below. It is process context but with a spinlock (bh_lock_sock) held, so you still can't sleep. IOW, you have to pass a proper gfp flag to reflect this.