<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:30:35 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-3055] Possible deadlock in put_pages_on_daemon_list()</title>
                <link>https://jira.whamcloud.com/browse/LU-3055</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;By running the Coverity tool on the Lustre code, we may have found a possible thread deadlock.&lt;/p&gt;

&lt;p&gt;In function put_pages_on_daemon_list(), the loop with cfs_tcd_for_each_type_lock() acquires the lock &quot;cfs_trace_cpu_data.tcd_lock&quot;. And inside this loop, the call to put_pages_on_tcd_daemon_list() acquires the lock &quot;page_collection.pc_lock&quot;.&lt;/p&gt;

&lt;p&gt;However, we have two other cases where the locks tcd_lock and pc_lock are taken in reverse order.&lt;br/&gt;
In collect_pages_on_all_cpus(), spin_lock(&amp;amp;pc-&amp;gt;pc_lock) acquires the lock &quot;pc-&amp;gt;pc_lock&quot;, and then the loop with cfs_tcd_for_each_type_lock() acquires the lock &quot;cfs_trace_cpu_data.tcd_lock&quot;.&lt;br/&gt;
We have the same situation in put_pages_back_on_all_cpus().&lt;/p&gt;


&lt;p&gt;In the end it seems a thread deadlock could occur. What do you think?&lt;/p&gt;

&lt;p&gt;Sebastien.&lt;/p&gt;</description>
                <environment></environment>
        <key id="18145">LU-3055</key>
            <summary>Possible deadlock in put_pages_on_daemon_list()</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="17451">LU-2753</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="liang">Liang Zhen</assignee>
                                    <reporter username="sebastien.buisson">Sebastien Buisson</reporter>
                        <labels>
                            <label>coverity</label>
                    </labels>
                <created>Thu, 28 Mar 2013 15:48:48 +0000</created>
                <updated>Fri, 25 Oct 2013 13:23:31 +0000</updated>
                            <resolved>Fri, 25 Oct 2013 13:23:31 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                                    <fixVersion>Lustre 2.6.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="55034" author="pjones" created="Thu, 28 Mar 2013 17:59:37 +0000"  >&lt;p&gt;Liang&lt;/p&gt;

&lt;p&gt;Are you able to comment?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="66693" author="liang" created="Sun, 15 Sep 2013 14:55:59 +0000"  >&lt;p&gt;This code is not very clean, but it&apos;s impossible to deadlock:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;put_pages_on_daemon_list() is only called by kthread tracefiled(), and @pc here is a structure in thread stack&lt;/li&gt;
	&lt;li&gt;the only chance that the same @pc can be referred by collect_pages_on_all_cpus() is, the thread thread call collect_pages()-&amp;gt;&amp;gt;collect_pages_on_all_cpus()&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;so @pc is not going to be shared between different threads.&lt;br/&gt;
Actually, after I looked into code, I think pc_lock is totally useless, it&apos;s there because we used to have a function trace_call_on_all_cpus() and it&apos;s supposed to protect race between CPUs (see BZ15878), now all use-cases of page_collection are actually just per-thread and in-stack, so we can simply remove this lock.&lt;/p&gt;</comment>
                            <comment id="68432" author="liang" created="Sat, 5 Oct 2013 03:39:02 +0000"  >&lt;p&gt;patch is ready to land: &lt;a href=&quot;http://review.whamcloud.com/#/c/7660/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/7660/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="69895" author="pjones" created="Fri, 25 Oct 2013 13:23:31 +0000"  >&lt;p&gt;Landed for 2.6&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|hzvmkf:</customfieldvalue>

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