]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
SUNRPC: remove scheduling boost for "SWAPPER" tasks.
authorNeilBrown <neilb@suse.de>
Sun, 6 Mar 2022 23:41:44 +0000 (10:41 +1100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:59:26 +0000 (11:59 +0200)
BugLink: https://bugs.launchpad.net/bugs/1969107
[ Upstream commit a80a8461868905823609be97f91776a26befe839 ]

Currently, tasks marked as "swapper" tasks get put to the front of
non-priority rpc_queues, and are sorted earlier than non-swapper tasks on
the transport's ->xmit_queue.

This is pointless as currently *all* tasks for a mount that has swap
enabled on *any* file are marked as "swapper" tasks.  So the net result
is that the non-priority rpc_queues are reverse-ordered (LIFO).

This scheduling boost is not necessary to avoid deadlocks, and hurts
fairness, so remove it.  If there were a need to expedite some requests,
the tk_priority mechanism is a more appropriate tool.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit a553864050944656c6225056d3704500fbbf6f38)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
net/sunrpc/sched.c
net/sunrpc/xprt.c

index 6e4d476c63248bc3fa4c7a9a55e5c14270ba8e1c..f0f55fbd13752903030e70685aa7c81386e1fbd4 100644 (file)
@@ -186,11 +186,6 @@ static void __rpc_add_wait_queue_priority(struct rpc_wait_queue *queue,
 
 /*
  * Add new request to wait queue.
- *
- * Swapper tasks always get inserted at the head of the queue.
- * This should avoid many nasty memory deadlocks and hopefully
- * improve overall performance.
- * Everyone else gets appended to the queue to ensure proper FIFO behavior.
  */
 static void __rpc_add_wait_queue(struct rpc_wait_queue *queue,
                struct rpc_task *task,
@@ -199,8 +194,6 @@ static void __rpc_add_wait_queue(struct rpc_wait_queue *queue,
        INIT_LIST_HEAD(&task->u.tk_wait.timer_list);
        if (RPC_IS_PRIORITY(queue))
                __rpc_add_wait_queue_priority(queue, task, queue_priority);
-       else if (RPC_IS_SWAPPER(task))
-               list_add(&task->u.tk_wait.list, &queue->tasks[0]);
        else
                list_add_tail(&task->u.tk_wait.list, &queue->tasks[0]);
        task->tk_waitqueue = queue;
index 61603c2664a604371c4fbf27b0b017a9b76c4454..f5dff09154da78de75cda890fa7cb5c2f755e7a9 100644 (file)
@@ -1353,17 +1353,6 @@ xprt_request_enqueue_transmit(struct rpc_task *task)
                                INIT_LIST_HEAD(&req->rq_xmit2);
                                goto out;
                        }
-               } else if (RPC_IS_SWAPPER(task)) {
-                       list_for_each_entry(pos, &xprt->xmit_queue, rq_xmit) {
-                               if (pos->rq_cong || pos->rq_bytes_sent)
-                                       continue;
-                               if (RPC_IS_SWAPPER(pos->rq_task))
-                                       continue;
-                               /* Note: req is added _before_ pos */
-                               list_add_tail(&req->rq_xmit, &pos->rq_xmit);
-                               INIT_LIST_HEAD(&req->rq_xmit2);
-                               goto out;
-                       }
                } else if (!req->rq_seqno) {
                        list_for_each_entry(pos, &xprt->xmit_queue, rq_xmit) {
                                if (pos->rq_task->tk_owner != task->tk_owner)