SUNRPC: discard SP_CONGESTED
authorNeilBrown <neilb@suse.de>
Mon, 11 Sep 2023 14:39:17 +0000 (10:39 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:05 +0000 (12:44 -0400)
We can tell if a pool is congested by checking if the idle list is
empty.  We don't need a separate flag.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/svc.h
net/sunrpc/svc.c
net/sunrpc/svc_xprt.c

index e9c34e99bc88abe62b84eaa8de5244953a4f0bd7..22b3018ebf62ed1a7c6005a45db0f95df10f92fa 100644 (file)
@@ -50,7 +50,6 @@ struct svc_pool {
 /* bits for sp_flags */
 enum {
        SP_TASK_PENDING,        /* still work to do even if no xprt is queued */
-       SP_CONGESTED,           /* all threads are busy, none idle */
        SP_NEED_VICTIM,         /* One thread needs to agree to exit */
        SP_VICTIM_REMAINS,      /* One thread needs to actually exit */
 };
index 9d080fe2dcdfa528694017a50434896f37d5f470..db4674211f36746fe51cef47ee115cbce51538e3 100644 (file)
@@ -719,7 +719,6 @@ void svc_pool_wake_idle_thread(struct svc_pool *pool)
        }
        rcu_read_unlock();
 
-       set_bit(SP_CONGESTED, &pool->sp_flags);
 }
 EXPORT_SYMBOL_GPL(svc_pool_wake_idle_thread);
 
index ebfeeb504a7955d4a31672a69ee9b6988dd7e1cb..fa0d854a55961169cdd86d88588bb312774a3bf9 100644 (file)
@@ -735,8 +735,6 @@ static void svc_rqst_wait_for_work(struct svc_rqst *rqstp)
 
        if (rqst_should_sleep(rqstp)) {
                set_current_state(TASK_IDLE);
-               smp_mb__before_atomic();
-               clear_bit(SP_CONGESTED, &pool->sp_flags);
                spin_lock_bh(&pool->sp_lock);
                list_add(&rqstp->rq_idle, &pool->sp_idle_threads);
                spin_unlock_bh(&pool->sp_lock);
@@ -874,7 +872,7 @@ void svc_recv(struct svc_rqst *rqstp)
                /* Normally we will wait up to 5 seconds for any required
                 * cache information to be provided.
                 */
-               if (!test_bit(SP_CONGESTED, &pool->sp_flags))
+               if (!list_empty(&pool->sp_idle_threads))
                        rqstp->rq_chandle.thread_wait = 5 * HZ;
                else
                        rqstp->rq_chandle.thread_wait = 1 * HZ;