Details
-
Improvement
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
3
-
9223372036854775807
Description
The server_lsi2mti() uses LNetGetId() call to get local NIDs on target start. It gets one NID per call by its 'index' which is not index in an array but amount other NIDs to skip. So at each call it traverses both networks and nids lists resulting O(n^2) time complexity.
Moreover, whole search is not protected, networks and nids lists in LNet may change between calls making result not reliable.
This can be re-implemented as single call to LNet with the following benefits:
- avoid multiple calls to LNetGetId() with traversing
both networks and nids lists from the beginning for
each NID, i.e. it is now O(n ) instead of O(n^2) complexity - less load on LNet in terms of lock contentions
- consistent results as Lnet lists can't be changed
during call - can specify single network to get NIDs from