<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:02:49 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-13621] LNET peer doesn&apos;t distribute well to different CPT</title>
                <link>https://jira.whamcloud.com/browse/LU-13621</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;If server has more than one CPT, each peer connection should be able to distributed to different CPT as a load-balancing perspective.&lt;br/&gt;
 An decision of CPT is based on a hash function with peer NID&apos;s address, but some cases, hash returns same value and both peers went to same CPT eventually.&lt;br/&gt;
 This causes a critical performance problem since number of CPU core belongs to each CPT and if both peers go to single CPT on server to handle, a half of CPU are alway busy and other half of CPU are idle.&lt;/p&gt;

&lt;p&gt;Here is an example.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;server# cat /sys/kernel/debug/lnet/cpu_partition_table
0	: 0 1 2 3 4 5 6 7 8 9
1	: 10 11 12 13 14 15 16 17 18 19

server# lnetctl net show
net:
    - net type: lo
      local NI(s):
        - nid: 0@lo
          status: up
    - net type: o2ib10
      local NI(s):
        - nid: 10.0.11.224@o2ib10
          status: up
          interfaces:
              0: ib0

client # cat /sys/kernel/debug/lnet/cpu_partition_table
0	: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1	: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2	: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
3	: 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
4	: 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
5	: 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
6	: 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
7	: 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

client # lnetctl net show -v
    - net type: o2ib10
      local NI(s):
        - nid: 10.0.11.81@o2ib10
          status: up
          interfaces:
              0: ib0
 - snip -
          lnd tunables:
          dev cpt: 0
          tcp bonding: 0
          CPT: &quot;[0,1,2,3]&quot;

        - nid: 10.4.11.71@o2ib10
          status: up
          interfaces:
              0: ib4
- snip -
          lnd tunables:
          dev cpt: 4
          tcp bonding: 0
          CPT: &quot;[4,5,6,7]&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;on client.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;   PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                          
 20263 root      20   0       0      0      0 R  98.3   0.0   0:29.85 kiblnd_sd_06_01                                  
 20264 root      20   0       0      0      0 R  98.3   0.0   0:29.85 kiblnd_sd_06_02                                  
 20265 root      20   0       0      0      0 R  98.3   0.0   0:29.85 kiblnd_sd_06_03                                  
 20262 root      20   0       0      0      0 R  98.0   0.0   0:29.84 kiblnd_sd_06_00                                  
 20247 root      20   0       0      0      0 R  89.1   0.0   1:19.11 kiblnd_sd_02_01                                  
 20248 root      20   0       0      0      0 R  88.7   0.0   1:19.20 kiblnd_sd_02_02                                  
 20249 root      20   0       0      0      0 R  88.7   0.0   1:19.15 kiblnd_sd_02_03                                  
 20246 root      20   0       0      0      0 R  87.7   0.0   1:19.24 kiblnd_sd_02_00    
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Two CPT are busy becouse of two interfaces.&lt;/p&gt;

&lt;p&gt;On server&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                            
27651 root      20   0       0      0      0 R  86.0  0.0   2:22.27 kiblnd_sd_00_00                                    
27652 root      20   0       0      0      0 R  86.0  0.0   2:22.30 kiblnd_sd_00_01                                    
27653 root      20   0       0      0      0 R  86.0  0.0   2:22.27 kiblnd_sd_00_02                                    
27654 root      20   0       0      0      0 R  85.4  0.0   2:22.28 kiblnd_sd_00_03  
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Only an CPT is busy even for two peers are connected to server.&lt;/p&gt;

&lt;p&gt;Amir added an debug patch and confirmed both peers went to first CPT.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;00000800:00000200:18.0:1591055201.186835:0:20660:0:(o2iblnd.c:795:kiblnd_create_conn()) peer_ni = 10.0.11.81@o2ib10, ni = 10.0.11.224@o2ib10, cpt = 0
00000800:00000200:18.0:1591055201.189343:0:20660:0:(o2iblnd.c:795:kiblnd_create_conn()) peer_ni = 10.4.11.81@o2ib10, ni = 10.0.11.224@o2ib10, cpt = 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The problem hash function retuns same value even client IP address chagned below, then both peers eventually go to same CPT on server if server has only single interface.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;1407418001001297 nid1 of client 64 bit representation
1407418001263431 nid2 of client 64 bit rpresentation
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment>a server (1 x IB-EDR) and a client (2 x IB-HDR100) and MR enabled</environment>
        <key id="59413">LU-13621</key>
            <summary>LNET peer doesn&apos;t distribute well to different CPT</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="61315">LU-14064</parent>
                                    <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="ssmirnov">Serguei Smirnov</assignee>
                                    <reporter username="sihara">Shuichi Ihara</reporter>
                        <labels>
                    </labels>
                <created>Tue, 2 Jun 2020 09:35:18 +0000</created>
                <updated>Wed, 22 Mar 2023 21:17:28 +0000</updated>
                            <resolved>Thu, 5 May 2022 13:26:23 +0000</resolved>
                                    <version>Lustre 2.14.0</version>
                                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                            <comments>
                            <comment id="273387" author="gerrit" created="Fri, 19 Jun 2020 23:52:59 +0000"  >&lt;p&gt;Amir Shehata (ashehata@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/39113&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/39113&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13621&quot; title=&quot;LNET peer doesn&amp;#39;t distribute well to different CPT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13621&quot;&gt;&lt;del&gt;LU-13621&lt;/del&gt;&lt;/a&gt; lnet: utility to print cpt number&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: c0ead63ee1edec2680656d2e1593cf56a637c222&lt;/p&gt;</comment>
                            <comment id="273390" author="ashehata" created="Sat, 20 Jun 2020 00:18:32 +0000"  >&lt;p&gt;I added a command to print the cpt number (or index of the cpt if the NI is bound to a set of CPTs). I think it would be useful to be able to pull this information out without having to dive into the kernel.&lt;/p&gt;

&lt;p&gt;Using this utility it shows that varying the first 2 octets of the IP address and the net name/number does not change the cpt value the NID is being hashed to. This is something to be aware of on existing installation. Depending on the addressing scheme the site uses, we could endup with a situation where all the NIDs are being hashed into the same CPT. This will create a problem with CPT locking and will create a problem at the LND, since we&apos;ll be picking a scheduler thread from the same CPT pool.&lt;/p&gt;</comment>
                            <comment id="304993" author="adilger" created="Mon, 21 Jun 2021 04:38:25 +0000"  >&lt;p&gt;Shuichi, is it true that the CPT hash function is imbalanced even if there are multiple CPTs and multiple clients connecting (e.g. 32 clients connecting to a server with 4 CPTs)?  There are &lt;b&gt;always&lt;/b&gt; going to be cases where two clients will map to a single CPT (in this case 10.4.11.71 and 10.4.11.81) no matter which mapping function is used.  However, it is a much bigger problem if, say, 32 clients with sequential NIDs are not uniformly distributed across the CPTs on the server, or within 1 of an even split.&lt;/p&gt;</comment>
                            <comment id="324505" author="gerrit" created="Mon, 31 Jan 2022 01:25:27 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/39113/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/39113/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13621&quot; title=&quot;LNET peer doesn&amp;#39;t distribute well to different CPT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13621&quot;&gt;&lt;del&gt;LU-13621&lt;/del&gt;&lt;/a&gt; lnet: utility to print cpt number&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: df6f17ee97ac47c949c1963ff8d57fb2d4becd06&lt;/p&gt;</comment>
                            <comment id="333861" author="pjones" created="Thu, 5 May 2022 13:26:23 +0000"  >&lt;p&gt;Seems to be landed for 2.15&lt;/p&gt;</comment>
                            <comment id="366946" author="gerrit" created="Wed, 22 Mar 2023 21:17:28 +0000"  >&lt;p&gt;&quot;Etienne AUJAMES &amp;lt;eaujames@ddn.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50381&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50381&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13621&quot; title=&quot;LNET peer doesn&amp;#39;t distribute well to different CPT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13621&quot;&gt;&lt;del&gt;LU-13621&lt;/del&gt;&lt;/a&gt; lnet: utility to print cpt number&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 82a00420f7d45e68dcf57ae7979d17c1a5085b66&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="64088">LU-14676</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i011rr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>