Whamcloud - gitweb
LU-16078 o2iblnd: Salt comp_vector 48/48148/2
authorIan Ziemba <ian.ziemba@hpe.com>
Thu, 23 Jun 2022 21:30:37 +0000 (16:30 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 Aug 2022 04:33:12 +0000 (04:33 +0000)
If conns_per_peer is greater than 1, all the connections targeting
the same peer are assigned the same comp_vector. This results in
multiple IB CQs targeting the same peer to be serialized on a single
comp_vector.

Help spread out the IB CQ work to multiple cores by salting
comp_vector based on number of connections.

1 client to 1 server LST 1M write results with 4 conns_per_peer and
RXE configured to spread out work based on comp_vector.

Before: 1377.92 MB/s
After: 3828.48 MB/s

Test-Parameters: trivial
HPE-bug-id: LUS-11043
Change-Id: I4e3e2056947ee54d6d65f17e238163c9dc38cd61
Signed-off-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-on: https://review.whamcloud.com/48148
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/klnds/o2iblnd/o2iblnd.c
lnet/klnds/o2iblnd/o2iblnd.h

index 9c9d251..7f882b0 100644 (file)
@@ -339,6 +339,7 @@ kiblnd_create_peer(struct lnet_ni *ni, struct kib_peer_ni **peerp,
        peer_ni->ibp_queue_depth = ni->ni_net->net_tunables.lct_peer_tx_credits;
        peer_ni->ibp_queue_depth_mod = 0;       /* try to use the default */
        kref_init(&peer_ni->ibp_kref);
+       atomic_set(&peer_ni->ibp_nconns, 0);
 
        INIT_HLIST_NODE(&peer_ni->ibp_list);
        INIT_LIST_HEAD(&peer_ni->ibp_conns);
@@ -650,8 +651,12 @@ kiblnd_get_completion_vector(struct kib_conn *conn, int cpt)
 
        mask = cfs_cpt_cpumask(lnet_cpt_table(), cpt);
 
-       /* hash NID to CPU id in this partition... */
-       ibp_nid = conn->ibc_peer->ibp_nid;
+       /* hash NID to CPU id in this partition... when targeting a single peer
+        * with multiple QPs, to engage more cores in CQ processing to a single
+        * peer, use ibp_nconns to salt the value the comp_vector value
+        */
+       ibp_nid = conn->ibc_peer->ibp_nid +
+               atomic_read(&conn->ibc_peer->ibp_nconns);
        off = do_div(ibp_nid, cpumask_weight(*mask));
        for_each_cpu(i, *mask) {
                if (off-- == 0)
@@ -964,6 +969,7 @@ kiblnd_create_conn(struct kib_peer_ni *peer_ni, struct rdma_cm_id *cmid,
         conn->ibc_state = state;
 
         /* 1 more conn */
+       atomic_inc(&peer_ni->ibp_nconns);
        atomic_inc(&net->ibn_nconns);
         return conn;
 
@@ -1033,6 +1039,7 @@ kiblnd_destroy_conn(struct kib_conn *conn)
 
                kiblnd_peer_decref(peer_ni);
                rdma_destroy_id(cmid);
+               atomic_dec(&peer_ni->ibp_nconns);
                atomic_dec(&net->ibn_nconns);
        }
 }
index 4c8581d..0a8547d 100644 (file)
@@ -688,6 +688,8 @@ struct kib_peer_ni {
        __u16                   ibp_queue_depth;
        /* reduced value which allows conn to be created if max fails */
        __u16                   ibp_queue_depth_mod;
+       /* Number of connections allocated. */
+       atomic_t                ibp_nconns;
 };
 
 #ifndef HAVE_IB_INC_RKEY