diff options
-rw-r--r-- | include/linux/sunrpc/svc.h | 1 | ||||
-rw-r--r-- | net/sunrpc/svc_xprt.c | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 676ddf53b3ee..1f0216b9a6c9 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -50,6 +50,7 @@ struct svc_pool { | |||
50 | unsigned int sp_nrthreads; /* # of threads in pool */ | 50 | unsigned int sp_nrthreads; /* # of threads in pool */ |
51 | struct list_head sp_all_threads; /* all server threads */ | 51 | struct list_head sp_all_threads; /* all server threads */ |
52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ | 52 | struct svc_pool_stats sp_stats; /* statistics on pool operation */ |
53 | int sp_task_pending;/* has pending task */ | ||
53 | } ____cacheline_aligned_in_smp; | 54 | } ____cacheline_aligned_in_smp; |
54 | 55 | ||
55 | /* | 56 | /* |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index b8e47fac7315..5a9d40c5a9f3 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -499,7 +499,8 @@ void svc_wake_up(struct svc_serv *serv) | |||
499 | rqstp->rq_xprt = NULL; | 499 | rqstp->rq_xprt = NULL; |
500 | */ | 500 | */ |
501 | wake_up(&rqstp->rq_wait); | 501 | wake_up(&rqstp->rq_wait); |
502 | } | 502 | } else |
503 | pool->sp_task_pending = 1; | ||
503 | spin_unlock_bh(&pool->sp_lock); | 504 | spin_unlock_bh(&pool->sp_lock); |
504 | } | 505 | } |
505 | } | 506 | } |
@@ -634,7 +635,13 @@ struct svc_xprt *svc_get_next_xprt(struct svc_rqst *rqstp, long timeout) | |||
634 | * long for cache updates. | 635 | * long for cache updates. |
635 | */ | 636 | */ |
636 | rqstp->rq_chandle.thread_wait = 1*HZ; | 637 | rqstp->rq_chandle.thread_wait = 1*HZ; |
638 | pool->sp_task_pending = 0; | ||
637 | } else { | 639 | } else { |
640 | if (pool->sp_task_pending) { | ||
641 | pool->sp_task_pending = 0; | ||
642 | spin_unlock_bh(&pool->sp_lock); | ||
643 | return ERR_PTR(-EAGAIN); | ||
644 | } | ||
638 | /* No data pending. Go to sleep */ | 645 | /* No data pending. Go to sleep */ |
639 | svc_thread_enqueue(pool, rqstp); | 646 | svc_thread_enqueue(pool, rqstp); |
640 | 647 | ||