<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:28:31 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-2825] shrink cl_page structure size</title>
                <link>https://jira.whamcloud.com/browse/LU-2825</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Looking at struct cl_page there seems to be a lot of wasted memory, and since there may be millions of these structures in memory for every client, this wasted space can be considerable.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;32-bit cp_ref is followed by 64-bit cp_obj, wastes 4 bytes&lt;/li&gt;
	&lt;li&gt;32-bit cp_state is followed by 64-bit cp_batch, wastes 4 bytes&lt;/li&gt;
	&lt;li&gt;cp_state only has 5 states, could fit into a 3-bit field&lt;/li&gt;
	&lt;li&gt;cp_type only has 1 bit, could fit into a 1-bit field, and is immutable after creation so no worries about racy updates/locking&lt;/li&gt;
	&lt;li&gt;32-bit cp_flags is followed by 64-bit cp_sync_io, wastes 4 bytes&lt;/li&gt;
	&lt;li&gt;cp_flags only has 1 bit, could fit into a 1-bit field (not totally sure about locking)&lt;/li&gt;
	&lt;li&gt;64-bit cp_task is only set in 2 places, and never used&lt;/li&gt;
	&lt;li&gt;64-bit cp_queue_ref and cp_obj_ref are only used under USE_LU_REF and can also be made conditional&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The structure cl_req has similar space wastage, though it isn&apos;t used as often as cl_page:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;32-bit crq_type is followed by 64-bit crq_pages, wastes 4 bytes&lt;/li&gt;
	&lt;li&gt;crq_type only uses two flags, could be a bitfield&lt;/li&gt;
	&lt;li&gt;32-bit crq_npages is followed by 64-bi crq_o, wastes 4 bytes&lt;/li&gt;
	&lt;li&gt;32-bit crq_nrobjs is followed by 64-bit crq_layers, wastes 4 bytes&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Using the &quot;pahole&quot; program (part of the &quot;dwarves&quot; package) can report on binary structures for space wastage and alignment problems.&lt;/p&gt;</description>
                <environment></environment>
        <key id="17603">LU-2825</key>
            <summary>shrink cl_page structure size</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="6" iconUrl="https://jira.whamcloud.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="jay">Jinshan Xiong</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Mon, 18 Feb 2013 02:45:20 +0000</created>
                <updated>Thu, 8 Feb 2018 18:17:42 +0000</updated>
                            <resolved>Thu, 8 Feb 2018 18:17:42 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="63536" author="spimpale" created="Fri, 2 Aug 2013 07:26:58 +0000"  >&lt;p&gt;Hi Andreas,&lt;/p&gt;

&lt;p&gt;I have opened a review request for this here -&amp;gt; &lt;a href=&quot;http://review.whamcloud.com/#/c/7210/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/7210/&lt;/a&gt;&lt;br/&gt;
I have made the following changes:&lt;/p&gt;

&lt;p&gt;cl_page:&lt;br/&gt;
1) changed the position of cp_ref, cp_state, cp_flags and cp_type to better suit the alignment.&lt;br/&gt;
2) Converted cp_flags and cp_type members to bitfields of sizes 1 and 2 bits respectively.&lt;br/&gt;
3) Could not change cp_state to a bitfield since we access its address at one place.&lt;br/&gt;
This leads to a saving of 16 bytes. &lt;/p&gt;

&lt;p&gt;cl_req:&lt;br/&gt;
1) changed the position of crq_nrpages for better alignment.&lt;br/&gt;
2) converted crq_type to a bitfield of 2 bits.&lt;br/&gt;
This leads to a saving of 8 bytes.&lt;/p&gt;</comment>
                            <comment id="220450" author="jay" created="Thu, 8 Feb 2018 18:17:42 +0000"  >&lt;p&gt;close old tickets&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|hzvjan:</customfieldvalue>

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