2.4.4 linearize UDP RPC requests using GFP_KERNEL...
Subsystems (3)
PATCH 1/1 2.4.4 linearize UDP RPC requests using GFP_KERNEL...
Hi,
The zero-copy TCP patch that was integrated in 2.4.4 has allowed us
to move the task of reassembling of the fragments into one buffer until we're out of the ->data_ready() bottom half context.
In 2.4.4 therefore, the nfsd thread can end up calling the functionskb_linearize(), in order to allocate a new buffer and copy over the fragments.
IMHO allocating the buffer using GFP_ATOMIC is a mistake. As I said
we're in a thread context, so sleeping in GFP_KERNEL is safe. In addition, the cost of dropping the request if we can't allocate the buffer is heavy in that the client has to wait for a timeout, and then retry.
I'd therefore like to propose the following change.
Cheers,
Trond
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c.orig +1 -1
@@ -383,7 +383,7 @@/* Sorry. */ if (skb_is_nonlinear (skb)) { -if (skb_linearize (skb,GFP_ATOMIC ) !=0 ) { +if (skb_linearize (skb,GFP_KERNEL ) !=0 ) {kfree_skb (skb);svc_sock_received (svsk,0 );return 0 ;
Quoted 7 lines · Trond Myklebust
IMHO allocating the buffer using
GFP_ATOMICis a mistake. As I said
we're in a thread context, so sleeping inGFP_KERNELis safe. In addition, the cost of dropping the request if we can't allocate the buffer is heavy in that the client has to wait for a timeout, and then retry.I'd therefore like to propose the following change.
...
Quoted 2 lines
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c.orig +0
-0
...
net/sunrpc/svcsock.c line 386
Quoted 2 lines
net/sunrpc/svcsock.c renamed from net/sunrpc/svcsock.c.orig +1
-1-if (skb_linearize (skb,GFP_ATOMIC ) !=0 ) { +if (skb_linearize (skb,GFP_KERNEL ) !=0 ) {
No arguments here.
Later,
David S. Miller
[email protected]