Messages in this thread | | | Date | Mon, 29 Jun 2015 16:00:42 +0200 | Subject | Re: [PATCH] sock: honor GFP_ATOMIC when allocating send skbs | From | "Jason A. Donenfeld" <> |
| |
Hi Eric,
Thanks for your feedback on this. The precise problem is a BUG in the scheduler code when sleep is called from atomic context, due to having to wait on that allocation. This is triggered by a module I'm writing.
I'm probably doing something I shouldn't... I'm calling udp_sendmsg from atomic context: bad news bears, right? Really what I'd like to do is create an skb with headroom, fill it with data, and then hand it off to the udp/ip stack to prepend the udp and ip headers and calculate the flowi4 and correct dev and checksums for the skb. But I can't seem to find a correct API for this. So instead I'm using a socket and calling sendmsg on it, which unfortunately winds up in an extra allocation and a memcpy when sending. Might there be a better way to do what I want? That is: pass a buffer off to the networking stack, a) with zero copies [without having to use sendpage], and b) from atomic context. I'd like to avoid using workqueues/kthreads/etc if possible.
Thanks, Jason
| |