summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-03-27 10:50:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-04-03 15:08:11 -0400
commit7dbb53baed3c3969dea43e3cee261a75adde123c (patch)
tree7937074ff646970afd250412c121a8d5f5238415 /net
parentcaa3e106dc623eb41542e6221abecf9956e8a0e6 (diff)
sunrpc: Simplify do_enqueue tracing
There are three cases where svc_xprt_do_enqueue() returns without waking an nfsd thread: 1. There is no work to do 2. The transport is already busy 3. There are no available nfsd threads Only 3. is truly interesting. Move the trace point so it records that there was work to do and either an nfsd thread was awoken, or a free one could not found. As an additional clean up, remove a redundant comment and a couple of dprintk call sites. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc_xprt.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 71f47187b4ec..5fe150c78d0a 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -382,25 +382,21 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt)
382 int cpu; 382 int cpu;
383 383
384 if (!svc_xprt_has_something_to_do(xprt)) 384 if (!svc_xprt_has_something_to_do(xprt))
385 goto out; 385 return;
386 386
387 /* Mark transport as busy. It will remain in this state until 387 /* Mark transport as busy. It will remain in this state until
388 * the provider calls svc_xprt_received. We update XPT_BUSY 388 * the provider calls svc_xprt_received. We update XPT_BUSY
389 * atomically because it also guards against trying to enqueue 389 * atomically because it also guards against trying to enqueue
390 * the transport twice. 390 * the transport twice.
391 */ 391 */
392 if (test_and_set_bit(XPT_BUSY, &xprt->xpt_flags)) { 392 if (test_and_set_bit(XPT_BUSY, &xprt->xpt_flags))
393 /* Don't enqueue transport while already enqueued */ 393 return;
394 dprintk("svc: transport %p busy, not enqueued\n", xprt);
395 goto out;
396 }
397 394
398 cpu = get_cpu(); 395 cpu = get_cpu();
399 pool = svc_pool_for_cpu(xprt->xpt_server, cpu); 396 pool = svc_pool_for_cpu(xprt->xpt_server, cpu);
400 397
401 atomic_long_inc(&pool->sp_stats.packets); 398 atomic_long_inc(&pool->sp_stats.packets);
402 399
403 dprintk("svc: transport %p put into queue\n", xprt);
404 spin_lock_bh(&pool->sp_lock); 400 spin_lock_bh(&pool->sp_lock);
405 list_add_tail(&xprt->xpt_ready, &pool->sp_sockets); 401 list_add_tail(&xprt->xpt_ready, &pool->sp_sockets);
406 pool->sp_stats.sockets_queued++; 402 pool->sp_stats.sockets_queued++;
@@ -420,7 +416,6 @@ void svc_xprt_do_enqueue(struct svc_xprt *xprt)
420out_unlock: 416out_unlock:
421 rcu_read_unlock(); 417 rcu_read_unlock();
422 put_cpu(); 418 put_cpu();
423out:
424 trace_svc_xprt_do_enqueue(xprt, rqstp); 419 trace_svc_xprt_do_enqueue(xprt, rqstp);
425} 420}
426EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue); 421EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue);