[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpWN36px=Kjbde-y93LboFMVxMVLPcFi9Hx=5fkvpo8ndA@mail.gmail.com>
Date: Fri, 19 May 2017 13:58:10 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Akshay Narayan <akshayn@....edu>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net] fix BUG: scheduling while atomic in netlink broadcast
On Fri, May 19, 2017 at 11:47 AM, Akshay Narayan <akshayn@....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.
Powered by blists - more mailing lists