<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:59: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-6378] Quota performance issue for 2.7 </title>
                <link>https://jira.whamcloud.com/browse/LU-6378</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In lustre 2.7, inode I_NEW state is cleared in the later phase, which cause the following owner/group changing (in osd_attr_init0()) will be performed in I_NEW state, which means the dquot_initialize() won&apos;t be skipped for these operations,&lt;/p&gt;

&lt;p&gt;2.7.0 &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;/**
 * Helper function for osd_object_create()
 *
 * \retval 0, on success
 */
static int __osd_object_create(struct osd_thread_info *info,
                               struct osd_object *obj, struct lu_attr *attr,
                               struct dt_allocation_hint *hint,
                               struct dt_object_format *dof,
                               struct thandle *th)
{
        int     result;
        __u32   umask;

        /* we drop umask so that permissions we pass are not affected */
        umask = current-&amp;gt;fs-&amp;gt;umask;
        current-&amp;gt;fs-&amp;gt;umask = 0;

        result = osd_create_type_f(dof-&amp;gt;dof_type)(info, obj, attr, hint, dof,
                                                  th);
        if (result == 0) {
                osd_attr_init(info, obj, attr, dof);
                osd_object_init0(obj);
        }

        if (obj-&amp;gt;oo_inode != NULL) {
                LASSERT(obj-&amp;gt;oo_inode-&amp;gt;i_state &amp;amp; I_NEW);

                unlock_new_inode(obj-&amp;gt;oo_inode);  ---&amp;gt;It will unlock new inode here, so it will cause the above osd_attr_init to call quota_initialization (with I_NEW).  But in 2.6.0, we used to unlock the new inode in ldiskfs_new_inode.
        }

        /* restore previous umask value */
        current-&amp;gt;fs-&amp;gt;umask = umask;

        return result;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is caused by this patch&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/13187&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13187&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
        <key id="29136">LU-6378</key>
            <summary>Quota performance issue for 2.7 </summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</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="yong.fan">nasf</assignee>
                                    <reporter username="di.wang">Di Wang</reporter>
                        <labels>
                    </labels>
                <created>Wed, 18 Mar 2015 01:28:25 +0000</created>
                <updated>Thu, 12 May 2016 12:44:48 +0000</updated>
                            <resolved>Wed, 29 Apr 2015 07:58:29 +0000</resolved>
                                    <version>Lustre 2.7.0</version>
                    <version>Lustre 2.8.0</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="109944" author="niu" created="Wed, 18 Mar 2015 01:54:33 +0000"  >&lt;p&gt;Actually, the quota-avoid-dqget-calls.patch shouldn&apos;t rely on I_NEW to skip the dqget()/dqput() calls, instead, it should check the i_dquot pointer directly.&lt;/p&gt;</comment>
                            <comment id="109951" author="yong.fan" created="Wed, 18 Mar 2015 07:45:27 +0000"  >&lt;p&gt;Here is the patch:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/#/c/14102/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/14102/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="110044" author="adilger" created="Wed, 18 Mar 2015 20:28:18 +0000"  >&lt;p&gt;I think the correct fix is as Niu writes.  The patch that was landed upstream didn&apos;t check I_NEW, but instead directly checked if the inode already had the quota initialized.  The &lt;tt&gt;lustre/kernel_patches/patches/quota-avoid-dqget-calls&lt;/tt&gt; patches should be updated to use the same code as was committed to the upstream kernel.&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;commit 1ea06bec78a128adc995ca32bd906a6c9bb9cf91
Author: Niu Yawei &amp;lt;yawei.niu@gmail.com&amp;gt;
Date:   Wed Jun 4 12:20:30 2014 +0800

    quota: avoid unnecessary dqget()/dqput() calls
    
    Avoid unnecessary dqget()/dqput() calls in __dquot_initialize(),
    that will introduce global lock contention otherwise.
    
    Signed-off-by: Lai Siyao &amp;lt;lai.siyao@intel.com&amp;gt;
    Signed-off-by: Niu Yawei &amp;lt;yawei.niu@intel.com&amp;gt;
    Signed-off-by: Jan Kara &amp;lt;jack@suse.cz&amp;gt;

diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 7f30bdc..2517719 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1402,7 +1402,7 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; dquot_active(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct inode *inode)
  */
 &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void __dquot_initialize(struct inode *inode, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type)
 {
-       &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; cnt;
+       &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; cnt, init_needed = 0;
        struct dquot *got[MAXQUOTAS];
        struct super_block *sb = inode-&amp;gt;i_sb;
        qsize_t rsv;
@@ -1418,6 +1418,15 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void __dquot_initialize(struct inode *inode, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type)
                got[cnt] = NULL;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (type != -1 &amp;amp;&amp;amp; cnt != type)
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
+               /*
+                * The i_dquot should have been initialized in most cases,
+                * we check it without locking here to avoid unnecessary
+                * dqget()/dqput() calls.
+                */
+               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (inode-&amp;gt;i_dquot[cnt])
+                       &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
+               init_needed = 1;
+
                &lt;span class=&quot;code-keyword&quot;&gt;switch&lt;/span&gt; (cnt) {
                &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; USRQUOTA:
                        qid = make_kqid_uid(inode-&amp;gt;i_uid);
@@ -1429,6 +1438,10 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void __dquot_initialize(struct inode *inode, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type)
                got[cnt] = dqget(sb, qid);
        }
 
+       &lt;span class=&quot;code-comment&quot;&gt;/* All required i_dquot has been initialized */&lt;/span&gt;
+       &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!init_needed)
+               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt;;
+
        down_write(&amp;amp;sb_dqopt(sb)-&amp;gt;dqptr_sem);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_NOQUOTA(inode))
                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; out_err;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="110061" author="yong.fan" created="Thu, 19 Mar 2015 02:11:21 +0000"  >&lt;p&gt;Since it has been committed to upstream, why still patch the kernel? As for the locked inode returned by ldiskfs_create_inode(), we can unlock it after the LDISKFS_STATE_LUSTRE_NOSCRUB set. It is unnecessary to hold the lock for osd_attr_init().&lt;/p&gt;

&lt;p&gt;Anyway, I do not mind the way of fixing quota patch.&lt;/p&gt;</comment>
                            <comment id="110065" author="adilger" created="Thu, 19 Mar 2015 02:42:03 +0000"  >&lt;p&gt;It is only in the upstream kernel after 3.16 or so, but we are applying the older patch to RHEL 6 and SLES 11 that checks I_NEW.&lt;/p&gt;

&lt;p&gt;If the current patch doesn&apos;t cause problems with LFSCK, then I don&apos;t mind to land it also, because holding a lock for less time is always better (assuming it is still correct). I&apos;d still like to fix the quota patch, because without that the performance will still be bad for non-root users. &lt;/p&gt;</comment>
                            <comment id="110079" author="yong.fan" created="Thu, 19 Mar 2015 11:24:47 +0000"  >&lt;p&gt;I have refreshed the patch &lt;a href=&quot;http://review.whamcloud.com/#/c/14102/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/14102/&lt;/a&gt; with this LU ticket.&lt;/p&gt;

&lt;p&gt;Niu, would you please to port your quota patch to master branch? Thanks!&lt;/p&gt;</comment>
                            <comment id="110324" author="gerrit" created="Mon, 23 Mar 2015 05:28:40 +0000"  >&lt;p&gt;Niu Yawei (yawei.niu@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/14135&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14135&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6378&quot; title=&quot;Quota performance issue for 2.7 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6378&quot;&gt;&lt;del&gt;LU-6378&lt;/del&gt;&lt;/a&gt; kernel: simplify quota-avoid-dqget-call.patch&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6fbe23b01f38847211334153330642eaf54b949a&lt;/p&gt;</comment>
                            <comment id="110325" author="niu" created="Mon, 23 Mar 2015 05:31:23 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Niu, would you please to port your quota patch to master branch? Thanks!&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Patch updated: &lt;a href=&quot;http://review.whamcloud.com/14135&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14135&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="110690" author="gerrit" created="Thu, 26 Mar 2015 00:01:16 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/14135/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14135/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6378&quot; title=&quot;Quota performance issue for 2.7 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6378&quot;&gt;&lt;del&gt;LU-6378&lt;/del&gt;&lt;/a&gt; kernel: simplify quota-avoid-dqget-call.patch&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 8b83f21acfd00c0dd8aeed529c07fbc1ecca5e22&lt;/p&gt;</comment>
                            <comment id="112371" author="yong.fan" created="Mon, 20 Apr 2015 09:44:17 +0000"  >&lt;p&gt;Oleg, would you please to consider the patch &lt;a href=&quot;http://review.whamcloud.com/#/c/14102/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/14102/&lt;/a&gt;, then we can close this ticket. Thanks!&lt;/p&gt;</comment>
                            <comment id="113592" author="gerrit" created="Tue, 28 Apr 2015 05:20:14 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/14102/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14102/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6378&quot; title=&quot;Quota performance issue for 2.7 &quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6378&quot;&gt;&lt;del&gt;LU-6378&lt;/del&gt;&lt;/a&gt; osd-ldiskfs: unlock inode before attr_init&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: cef4a7fdb1183deaf2cbb34849a3f9f7b9037da1&lt;/p&gt;</comment>
                            <comment id="113722" author="yong.fan" created="Wed, 29 Apr 2015 07:58:30 +0000"  >&lt;p&gt;The patches have been landed to master.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="29151">LU-6381</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|hzx8r3:</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>