[PATCH 1/1] NFS4.1 Session trunking dynamic roundrobin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 6a5f1b9974609d9d957631d5e573ec3490dc6bb6 Mon Sep 17 00:00:00 2001
From: Martin Houry <martinhoury@xxxxxxxxx>
Date: Thu, 3 Mar 2016 15:20:37 +0100
Subject: [PATCH 1/1] NFS4.1 Session trunking dynamic roundrobin

This patch needs following patchs to work:
Basic multipathing support and demonstrator - From Trond Myklebust
Request for Comment: NFS4.1 Session Trunking - From Andros

Here is a litle modification of the roundrobin algorithm of Trond.
It verifies the number of RPC task alocated to each transport and send the new
task to the less charged transport.

It brings better perfomance when a transport is slower than other.

Other questions comes in mind like :
How to detect a dead link and redistribute the tasks already allocated to him.
How to decide if a link is too slow to send task on it.
Is this modification will impact the performance when all links are identical?

This is my first patch and comments are welcome!

Signed-off-by Martin Houry <martinhoury@xxxxxxxxx>
---
 net/sunrpc/xprtmultipath.c |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c
index 149d259..e51c067 100644
--- a/net/sunrpc/xprtmultipath.c
+++ b/net/sunrpc/xprtmultipath.c
@@ -315,11 +315,26 @@ struct rpc_xprt
*xprt_switch_find_next_entry_roundrobin(struct list_head *head,
  const struct rpc_xprt *cur)
 {
  struct rpc_xprt *ret;
+ struct rpc_xprt *less_charged_xprt;
+ unsigned short waiting_requests;
+   unsigned short pending_requests;
+ unsigned short total_requests=1000;
+
+ ret = xprt_switch_find_first_entry(head);
+ less_charged_xprt = ret;
+ while(ret!=NULL){
+ waiting_requests = ret->sending.qlen;
+ pending_requests = ret->pending.qlen;
+ unsigned short effective_requests = waiting_requests + pending_requests;
+ if(effective_requests <= total_requests){
+ total_requests=effective_requests;
+ less_charged_xprt = ret;
+ }
+ ret = xprt_switch_find_next_entry(head, ret);
+ }
+ return less_charged_xprt;
+

- ret = xprt_switch_find_next_entry(head, cur);
- if (ret != NULL)
- return ret;
- return xprt_switch_find_first_entry(head);
 }

 static
-- 
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux