Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359705
b: refs/heads/master
c: 35525b7
h: refs/heads/master
i:
  359703: ce2242b
v: v3
  • Loading branch information
Andriy Skulysh authored and J. Bruce Fields committed Jan 23, 2013
1 parent f399a99 commit b1fc577
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 624ab4644819948e9dc87c114201e98f2e52490f
refs/heads/master: 35525b79786b2ba58ef13822198ce22c497bc7a2
1 change: 1 addition & 0 deletions trunk/include/linux/sunrpc/svc.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ struct svc_pool {
unsigned int sp_nrthreads; /* # of threads in pool */
struct list_head sp_all_threads; /* all server threads */
struct svc_pool_stats sp_stats; /* statistics on pool operation */
int sp_task_pending;/* has pending task */
} ____cacheline_aligned_in_smp;

/*
Expand Down
9 changes: 8 additions & 1 deletion trunk/net/sunrpc/svc_xprt.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ void svc_wake_up(struct svc_serv *serv)
rqstp->rq_xprt = NULL;
*/
wake_up(&rqstp->rq_wait);
}
} else
pool->sp_task_pending = 1;
spin_unlock_bh(&pool->sp_lock);
}
}
Expand Down Expand Up @@ -634,7 +635,13 @@ struct svc_xprt *svc_get_next_xprt(struct svc_rqst *rqstp, long timeout)
* long for cache updates.
*/
rqstp->rq_chandle.thread_wait = 1*HZ;
pool->sp_task_pending = 0;
} else {
if (pool->sp_task_pending) {
pool->sp_task_pending = 0;
spin_unlock_bh(&pool->sp_lock);
return ERR_PTR(-EAGAIN);
}
/* No data pending. Go to sleep */
svc_thread_enqueue(pool, rqstp);

Expand Down

0 comments on commit b1fc577

Please sign in to comment.