<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:10:28 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-14520] shrink ldlm_lock to fit in 512 bytes</title>
                <link>https://jira.whamcloud.com/browse/LU-14520</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In patch &lt;a href=&quot;https://review.whamcloud.com/39811&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/39811&lt;/a&gt; it removes &lt;tt&gt;l_lock&lt;/tt&gt; from &lt;tt&gt;struct ldlm_lock&lt;/tt&gt;, which also removes a 4-byte hole following &lt;tt&gt;l_lock&lt;/tt&gt;, giving an 8-byte size reduction down to 544 bytes.  It would be nice if we could find another 32 bytes of savings so that each lock could fit into a 512-byte allocation.&lt;/p&gt;

&lt;p&gt;While there isn&apos;t yet a clear path to the full reduction, there are a number of fields that are too large and could be shrunk&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;l_bl_ast_run looks like it could be a single bit (&lt;b&gt;4 bytes&lt;/b&gt; if packed somewhere else)&lt;/li&gt;
	&lt;li&gt;l_lvb_len looks like it could &lt;em&gt;just&lt;/em&gt; fit into a __u16 since this is limited (&lt;b&gt;2 bytes&lt;/b&gt;)&lt;br/&gt;
  by the maximum layout size, itself capped by XATTR_SIZE_MAX less a small amount for the xattr header&lt;/li&gt;
	&lt;li&gt;l_lvb_type only needs 4 bits (&lt;b&gt;4 bytes&lt;/b&gt; if packed somewhere else)&lt;/li&gt;
	&lt;li&gt;l_req_mode and l_granted_mode basically never change on a lock, and could fit into 8 bits by declaring the enum with a field width :8 (&lt;b&gt;6 bytes&lt;/b&gt;)&lt;/li&gt;
	&lt;li&gt;l_readers and l_writers are mostly accessed as booleans, and while they still need to be counters I don&apos;t think we&apos;ll ever have 4B threads in the kernel accessing the same lock at one time.  These could easily be shrunk to 24 bits (16M concurrent threads) or even a bit smaller to hold the few other bitfields (I&apos;m not sure I&apos;d be comfortable with only 64K threads since this might happen in a big NUMA machine), with l_req_mode and l_granted_mode put into the high bits. (&lt;b&gt;2 bytes&lt;/b&gt;)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;That is 18 bytes, so if we could find a couple of the many {{list_head}}s that could be shared it would be enough.  That would save many MB of RAM on the servers.&lt;/p&gt;</description>
                <environment></environment>
        <key id="63333">LU-14520</key>
            <summary>shrink ldlm_lock to fit in 512 bytes</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</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="wc-triage">WC Triage</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Mar 2021 10:33:44 +0000</created>
                <updated>Fri, 16 Jul 2021 22:15:30 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="294949" author="neilb" created="Sun, 14 Mar 2021 01:56:18 +0000"  >&lt;p&gt;h_rcu could be moved out of portals_handle, and unioned with something elsewhere that is completely irrelevant when the structure is being freed.&lt;/p&gt;

&lt;p&gt;l_waitq could be discarded and &apos;wait_var_event()&apos; used instead.&#160; If there are often lots (thousands?) of ldlm_locks all with active wait queues at the same time, this might not be a good idea.&lt;/p&gt;

&lt;p&gt;There seem to be some fields only used for bit locks (l_sl_mode, l_client_cookie) and some only used for extent locks (l_req_extent).&#160; These could be unioned together.&lt;/p&gt;

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

&lt;p&gt;And as you say, there are lots of list_heads...&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="307602" author="adilger" created="Fri, 16 Jul 2021 22:15:30 +0000"  >&lt;p&gt;On my current test system (&lt;tt&gt;2.14.51_86_gd656423&lt;/tt&gt;, EL7) the &lt;tt&gt;ldlm_lock&lt;/tt&gt; slab is using 576 bytes per object (even though &lt;tt&gt;struct ldlm_lock&lt;/tt&gt; is 544 bytes), with 28 locks in a 4-page slab.  I&apos;m assuming the extra 32 bytes per object is internal slab overhead/debug... We don&apos;t strictly need to shrink all the way down to 512 bytes/lock, it would be enough to remove just a few bytes per lock to allow this to have 29 or 30 locks per slab. &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|i01pef:</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>