From: Trond Myklebust Date: Fri, 24 Jun 2016 14:55:49 +0000 (-0400) Subject: SUNRPC: Micro optimisation for svc_data_ready X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4720b0703a0dfcd6da6a308ea71aaacc55beade7;p=linux-beck.git SUNRPC: Micro optimisation for svc_data_ready Don't call svc_xprt_enqueue() if the XPT_DATA flag is already set. Signed-off-by: Trond Myklebust Signed-off-by: J. Bruce Fields --- diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 03134708deeb..338d6fe1103d 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -409,8 +409,8 @@ static void svc_data_ready(struct sock *sk) svsk, sk, test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags)); svsk->sk_odata(sk); - set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); - svc_xprt_enqueue(&svsk->sk_xprt); + if (!test_and_set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags)) + svc_xprt_enqueue(&svsk->sk_xprt); } }