Hello!
> sock_alloc_send_skb() into a function callable from bh context.
> However, just resetting sk->allocation is not sufficient.
No doubts. It is exaclty, which I wanted to say.
> In order to make sock_alloc_send_skb() non-blocking under any circumstances,
> it was also necessary to set so->sndtimeo to 0. (sock_alloc_send_skb()
> will never enter sock_wait_for_wmem() if timeo is 0).
Sorry? This thing is called O_NONBLOCK. sndtimeo is additional baroque
detail, which is not used provided you do not touch it. Do not touch it.
> nbd.c does not play the latter trick.
Nobody needs to play such tricks.
What's about calling from interrupts (not the case with nbd),
no tricks will help. It is simply impossible to use top level
syscall from interrupt.
Alexey
|