<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:26:33 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-9479] sanity test 184d 244: don&apos;t instantiate PFL component when taking group lock </title>
                <link>https://jira.whamcloud.com/browse/LU-9479</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;This issue was created by maloo for bobijam &amp;lt;bobijam.xu@intel.com&amp;gt;&lt;/p&gt;

&lt;p&gt;This issue relates to the following test suite run: &lt;a href=&quot;https://testing.hpdd.intel.com/test_sets/67af86be-2027-11e7-9073-5254006e85c2&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://testing.hpdd.intel.com/test_sets/67af86be-2027-11e7-9073-5254006e85c2&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The sub-test test_244 failed with the following error:&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;test failed to respond and timed out
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Info required for matching: sanity 244&lt;/p&gt;


&lt;p&gt;sendfile_grouplock.c calls sendfile_copy(sourfile, 0, destfile, 98765)&lt;br/&gt;
and sendfile_copy()&amp;#45;&amp;gt;llapi_group_lock(fd_out, dest_gid);&lt;/p&gt;

&lt;p&gt;which will call into lov_io_init() and atomic_inc(&amp;amp;lov-&amp;gt;lo_active_ios)&lt;/p&gt;

&lt;p&gt;and sendfile_copy() tries to write to the file, which will check to get layout, and ll_layout_refresh() finds there is an active ios (marked by ll_get_grouplock()), so the write hung there&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;sendfile_grou S 0000000000000000     0  7394   7321 0x00000080
 ffff88000eb3f618 0000000000000082 ffff88000eb3f5e0 ffff88000eb3f5dc
 00001ce200000000 ffff88003f828400 0000005dce083b5f ffff880003436ac0
 00000000000005ff 0000000100017a1d ffff88002b57fad0 ffff88000eb3ffd8
Call Trace:
 [&amp;lt;ffffffffa0afa20b&amp;gt;] lov_layout_wait+0x11b/0x220 [lov]
 [&amp;lt;ffffffff810640e0&amp;gt;] ? default_wake_function+0x0/0x20
 [&amp;lt;ffffffffa0afc11e&amp;gt;] lov_conf_set+0x37e/0xa30 [lov]
 [&amp;lt;ffffffffa040f471&amp;gt;] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [&amp;lt;ffffffffa059d888&amp;gt;] cl_conf_set+0x58/0x100 [obdclass]
 [&amp;lt;ffffffffa0fa5dd4&amp;gt;] ll_layout_conf+0x84/0x3f0 [lustre]
 [&amp;lt;ffffffffa040f471&amp;gt;] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [&amp;lt;ffffffffa0fb0b9d&amp;gt;] ll_layout_refresh+0x96d/0x1710 [lustre]
 [&amp;lt;ffffffffa040f471&amp;gt;] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [&amp;lt;ffffffffa0ff7d6f&amp;gt;] vvp_io_init+0x32f/0x450 [lustre]
 [&amp;lt;ffffffffa040f471&amp;gt;] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [&amp;lt;ffffffffa05a5148&amp;gt;] cl_io_init0+0x88/0x150 [obdclass]
 [&amp;lt;ffffffffa05a7caa&amp;gt;] cl_io_init+0x4a/0xa0 [obdclass]
 [&amp;lt;ffffffffa05a7dbc&amp;gt;] cl_io_rw_init+0xbc/0x200 [obdclass]
 [&amp;lt;ffffffffa0fa7213&amp;gt;] ll_file_io_generic+0x203/0xaf0 [lustre]
 [&amp;lt;ffffffffa0fa941d&amp;gt;] ll_file_aio_write+0x13d/0x280 [lustre]
 [&amp;lt;ffffffffa0fa969a&amp;gt;] ll_file_write+0x13a/0x270 [lustre]
 [&amp;lt;ffffffff81189ef8&amp;gt;] vfs_write+0xb8/0x1a0
 [&amp;lt;ffffffff811ba76d&amp;gt;] kernel_write+0x3d/0x50
 [&amp;lt;ffffffff811ba7da&amp;gt;] write_pipe_buf+0x5a/0x90
 [&amp;lt;ffffffff811b9342&amp;gt;] splice_from_pipe_feed+0x72/0x120
 [&amp;lt;ffffffff811ba780&amp;gt;] ? write_pipe_buf+0x0/0x90
 [&amp;lt;ffffffff811ba780&amp;gt;] ? write_pipe_buf+0x0/0x90
 [&amp;lt;ffffffff811b9d9e&amp;gt;] __splice_from_pipe+0x6e/0x80
 [&amp;lt;ffffffff811ba780&amp;gt;] ? write_pipe_buf+0x0/0x90
 [&amp;lt;ffffffff811b9e01&amp;gt;] splice_from_pipe+0x51/0x70
 [&amp;lt;ffffffff811b9e3d&amp;gt;] default_file_splice_write+0x1d/0x30
 [&amp;lt;ffffffff811b9fca&amp;gt;] do_splice_from+0xba/0xf0
 [&amp;lt;ffffffff811ba020&amp;gt;] direct_splice_actor+0x20/0x30
 [&amp;lt;ffffffff811ba256&amp;gt;] splice_direct_to_actor+0xc6/0x1c0
 [&amp;lt;ffffffff811ba000&amp;gt;] ? direct_splice_actor+0x0/0x30
 [&amp;lt;ffffffff811ba39d&amp;gt;] do_splice_direct+0x4d/0x60
 [&amp;lt;ffffffff8118a344&amp;gt;] do_sendfile+0x184/0x1e0
 [&amp;lt;ffffffff8118a3d4&amp;gt;] sys_sendfile64+0x34/0xb0
 [&amp;lt;ffffffff810e031e&amp;gt;] ? __audit_syscall_exit+0x25e/0x290
 [&amp;lt;ffffffff8100b0d2&amp;gt;] system_call_fastpath+0x16/0x1b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="45980">LU-9479</key>
            <summary>sanity test 184d 244: don&apos;t instantiate PFL component when taking group lock </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="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="bobijam">Zhenyu Xu</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>pfl</label>
                    </labels>
                <created>Tue, 9 May 2017 20:40:37 +0000</created>
                <updated>Mon, 8 Jan 2024 20:13:13 +0000</updated>
                                            <version>Lustre 2.10.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="195186" author="adilger" created="Tue, 9 May 2017 20:48:15 +0000"  >&lt;p&gt;This problem was worked around in patch &lt;a href=&quot;https://review.whamcloud.com/26646&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/26646&lt;/a&gt; &quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-9344&quot; title=&quot;sanity test_244: sendfile_grouplock test12() test hung&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-9344&quot;&gt;&lt;del&gt;LU-9344&lt;/del&gt;&lt;/a&gt;  test: hung with sendfile_grouplock test12()&quot; by instantiating all of the file&apos;s components before taking the group lock.  However, for operations like &lt;tt&gt;lfs swap_layouts&lt;/tt&gt; in sanity.sh test_184d or &lt;tt&gt;lfs migrate&lt;/tt&gt; since this will instantiate all of the components even if the file is empty.  &lt;/p&gt;

&lt;p&gt;This is inefficient for the source file since it is about to be deleted, and for the destination file since it doesn&apos;t need all of those objects.&lt;/p&gt;

&lt;p&gt;Per comments in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-9344&quot; title=&quot;sanity test_244: sendfile_grouplock test12() test hung&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-9344&quot;&gt;&lt;del&gt;LU-9344&lt;/del&gt;&lt;/a&gt; and &lt;a href=&quot;https://review.whamcloud.com/26646&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/26646&lt;/a&gt; it makes sense to not instantiate the components of the source file, since it is not being modified.  It is also known what the file size is for writes during migration/swap_layouts, so it is possible to instantiate the required components in advance and leave any later ones alone.&lt;/p&gt;</comment>
                            <comment id="196722" author="bobijam" created="Tue, 23 May 2017 09:31:10 +0000"  >&lt;p&gt;Jinshan,&lt;/p&gt;

&lt;p&gt;from commit d25892863a30a385cdae2b1991ab0a9ca76fcd7d, the lov-&amp;gt;lo_active_ios was created, and get grouplock also increases it.&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;    LU-1876 hsm: account for active IOs correctly
    
    We used to use refcount of lsm to account for active IOs but this
    turns out wrong because empty layout files don&apos;t have a lsm.
    
    In this patch, lov_object::lo_active_ios is invented to account for
    active IOs for both raid0 and empty layout;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m think of not accounting get_grouplock as a active IOs so that process with the grouplock won&apos;t hung itself in the first place, do you think it&apos;s plausible?&lt;/p&gt;</comment>
                            <comment id="196723" author="bobijam" created="Tue, 23 May 2017 09:58:50 +0000"  >&lt;p&gt;well, even lo_active_ios is resolved with my last comment, there still exists problem that the later instantiated component does not protected by the prior given group lock.&lt;/p&gt;</comment>
                            <comment id="207094" author="adilger" created="Thu, 31 Aug 2017 17:37:18 +0000"  >&lt;p&gt;Bobijam, can you discuss with Oleg some way we could get group locks for newly-instantiated components that is not racy.  It seems that the workaround is not working properly, since there are now multiple problems with grouplocks being seen.&lt;/p&gt;</comment>
                            <comment id="221322" author="paf" created="Tue, 20 Feb 2018 21:05:41 +0000"  >&lt;p&gt;Is it not possible for a group lock to prevent instantiation of further components by those not holding a group lock?  It would imply a group lock also had to take a layout lock, though.&lt;/p&gt;</comment>
                            <comment id="221486" author="adilger" created="Thu, 22 Feb 2018 17:46:47 +0000"  >&lt;p&gt;Patrick, the problem here is that we don&apos;t want to prevent instantistion new component instantistion, but if new objects are instantisted they do not have a group lock on them (since that is handled between each OST and client separately for each object). &lt;/p&gt;</comment>
                            <comment id="221496" author="paf" created="Thu, 22 Feb 2018 18:29:13 +0000"  >&lt;p&gt;Right, I understand - Note &quot;instantiation of further components &lt;b&gt;by those not holding a group lock&lt;/b&gt;&quot;.  I think that&apos;s necessary because otherwise that problem you note occurs - The new segment doesn&apos;t get the old group lock applied to it.  I don&apos;t see a way to solve that, so instead holding a group lock should prevent instantiation of a new component by those &lt;b&gt;not holding the group lock&lt;/b&gt;, because otherwise they could get around the group lock and write to that new component.&lt;/p&gt;

&lt;p&gt;Those holding the group lock can do it, which gives them a chance to apply the group lock to the new component.&lt;/p&gt;

&lt;p&gt;This is still potentially problematic though, if the client who instantiated the new layout releases its group lock, other clients holding a group lock will not have that portion locked and so it could become unlocked.&lt;/p&gt;

&lt;p&gt;This is not fun.&lt;/p&gt;</comment>
                            <comment id="221505" author="adilger" created="Thu, 22 Feb 2018 19:32:11 +0000"  >&lt;p&gt;The issue is that group locks are handled by the OSS, but object instantiation is done by the MDS, so there is no way for the MDS to even know that there is a group lock on the file...&lt;/p&gt;</comment>
                            <comment id="221507" author="paf" created="Thu, 22 Feb 2018 19:42:36 +0000"  >&lt;p&gt;Yup...  No straightforward suggestions from me.&lt;/p&gt;</comment>
                            <comment id="228166" author="paf" created="Fri, 18 May 2018 18:45:53 +0000"  >&lt;p&gt;No intention to work on this right now, but I wanted to write this down here so it doesn&apos;t get forgotten:&lt;/p&gt;

&lt;p&gt;As Andreas said, the issue is that group locks are handled by the OSS, but object instantiation is handled by the MDS.&#160; As Oleg noted at LUG, given that, it seems like we need to move group locks to being layout locks.&lt;/p&gt;

&lt;p&gt;A few thoughts on this.&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;There is no provision (now) for group lock IDs in IBITS locks.&#160; There is enough room in the&#160;ldlm_wire_policy_data union to fit a gid in the IBITS case.&#160; And I&apos;m not sure how much of the rest of the mdc/mdt/IBITS LDLM code will need to be modified to support them correctly.&lt;/li&gt;
	&lt;li&gt;We still need data locks to cover the data i/o.&#160; So a group lock could start with locking the layout exclusively, then getting locks on all of the existing data components (ie just lock from 0 to EOF and not worry about uninstantiated components).&#160; Unlocking one would go in reverse order - unlock data, unlock layout.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;There may also be some ... interesting ... interoperability issues with clients that do not request/expect group locks on the layout.&#160; That might be challenging to get right.&lt;/p&gt;</comment>
                            <comment id="316272" author="adilger" created="Fri, 22 Oct 2021 01:24:34 +0000"  >&lt;p&gt;It is worthwhile to note that the &quot;MDS holds IBITS group lock&quot; issue is (partly) solved already via patch &lt;a href=&quot;https://review.whamcloud.com/39406&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/39406&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13645&quot; title=&quot;Various data corruptions possible in lustre.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13645&quot;&gt;&lt;del&gt;LU-13645&lt;/del&gt;&lt;/a&gt; ldlm: group locks for DOM IBIT lock&lt;/tt&gt;&quot;, which was commit v2_13_56-61-g0674044036 and as such is included in 2.14.0.&lt;/p&gt;

&lt;p&gt;That would potentially allow group locks to &lt;b&gt;always&lt;/b&gt; lock on the MDT first, and then lock only initialized components.  Older clients that don&apos;t understand the MDT group lock would (unfortunately) keep their current behavior of always instantiating and locking all components.&lt;/p&gt;

&lt;p&gt;The new MDS could potentially revoke the layout lock (and keep it) from older clients that do not have this functionality, to prevent non-group locks from instantiating uninitialized components, but there is unfortunately no &lt;tt&gt;OBD_CONNECT_&amp;#42;&lt;/tt&gt; flag for this.  It might be enough in 2.15 for a group lock to hold the &lt;tt&gt;MDS_INODEBITS_LAYOUT&lt;/tt&gt; lock exclusively, &lt;b&gt;if there are uninitialized components&lt;/b&gt; to block older clients, but this wouldn&apos;t be needed if all components are already initialized, or all clients are new and understand MDS group locking (a new &lt;tt&gt;OBD_CONNECT_&amp;#42;&lt;/tt&gt; flag could be added for this).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="59478">LU-13645</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="45499">LU-9341</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="42916">LU-8998</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="45506">LU-9344</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="45517">LU-9349</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="45812">LU-9429</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="79878">LU-17403</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="47174">LU-9756</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="47484">LU-9793</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="48585">LU-10070</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56863">LU-12738</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|hzzcaf:</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>