<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:40:41 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-11070] Partial page write by NFS</title>
                <link>https://jira.whamcloud.com/browse/LU-11070</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;When we were using Lustre below NFS then it is observed that the write &lt;br/&gt;
requests that we get is not page aligned even if the application is sending&lt;br/&gt;
it correctly. Mostly it is the first and last page which is not aligned.&lt;/p&gt;

&lt;p&gt;Obseravtion as per code analysis is that below function is causing the issue:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;&#160;

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; fill_in_write_vector(struct kvec *vec, struct nfsd4_write *write)
{
 &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; i = 1;
 &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; buflen = write-&amp;gt;wr_buflen;

vec[0].iov_base = write-&amp;gt;wr_head.iov_base;
 vec[0].iov_len = min_t(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;, buflen, write-&amp;gt;wr_head.iov_len); &amp;lt;======
 buflen -= vec[0].iov_len;

&lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; (buflen) {
 vec[i].iov_base = page_address(write-&amp;gt;wr_pagelist[i - 1]);
 vec[i].iov_len = min_t(&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;, PAGE_SIZE, buflen);
 buflen -= vec[i].iov_len;
 i++;
 }
 &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; i;
}

nfsd4_write()
{
:
 nvecs = fill_in_write_vector(rqstp-&amp;gt;rq_vec, write);
:
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;i.e. 0th vector is filled with min of buflen or wr_head and rest differently&lt;/p&gt;

&lt;p&gt;Because of this, first and last page is not aligned.&lt;/p&gt;

&lt;p&gt;Interestingly when such request hit Lustre write path, as the first page is &lt;br/&gt;
un-aligned (or partial) the whole write becomes un-aligned and causing performance &lt;br/&gt;
degradation. The performance degradation seems mostly because of un-aglined&lt;br/&gt;
write causing read rpcs.&lt;/p&gt;


&lt;p&gt;Possible Solution:&lt;br/&gt;
==================&lt;/p&gt;

&lt;p&gt;As we can see here first partial size vector causing all following page size&lt;br/&gt;
vector to be considered as partial. Which in tern causing read requests/rpcs.&lt;br/&gt;
I think, we can avoid those read requests as we know first partial vector&lt;br/&gt;
is causing this. We can detect it by scanning the vector (we are already&lt;br/&gt;
iterating over it). Based on this thought/approach cook proto-type patch.&lt;/p&gt;

&lt;p&gt;Seeking feedback on this approach or any question/suggestion/concern on the same ?&lt;/p&gt;

&lt;p&gt;Following stats are collected without and with patch.&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;salloc -N 8 --ntasks-per-node=16 mpirun --allow-run-as-root /work/tools/bin/ior -a POSIX -w -r -vv -e -t 1m -b 2g -C -Q 21 -F -o /scratch1_nfs/file&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;lustre-2.10.4&lt;br/&gt;
Max Write: 379.60 MiB/sec (398.03 MB/sec)&lt;br/&gt;
Max Read: 4618.64 MiB/sec (4842.99 MB/sec)&lt;/p&gt;

&lt;p&gt;lustre-2.10.4/w proto-type patch&lt;br/&gt;
Max Write: 3817.34 MiB/sec (4002.77 MB/sec)&lt;br/&gt;
Max Read: 4474.30 MiB/sec (4691.64 MB/sec)&lt;/p&gt;</description>
                <environment></environment>
        <key id="52455">LU-11070</key>
            <summary>Partial page write by NFS</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="rdeshmukh_wc">Rahul Deshmukh</assignee>
                                    <reporter username="rdeshmukh_ddn">Rahul Deshmukh</reporter>
                        <labels>
                    </labels>
                <created>Sat, 2 Jun 2018 19:47:45 +0000</created>
                <updated>Fri, 17 Aug 2018 22:11:09 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="229011" author="gerrit" created="Sat, 2 Jun 2018 20:27:30 +0000"  >&lt;p&gt;Rahul Deshmukh (rdeshmukh@ddn.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32611&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32611&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11070&quot; title=&quot;Partial page write by NFS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11070&quot;&gt;LU-11070&lt;/a&gt; llite: Partial page write by NFS&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 2f52493ccdf19a6a426e1443ead6b62b119c4448&lt;/p&gt;</comment>
                    </comments>
                    <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|hzzy0n:</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>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>