<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:21:43 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-15837] &quot;lfs find -printf&quot; improvements</title>
                <link>https://jira.whamcloud.com/browse/LU-15837</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Per Rick&apos;s LUG presentation, there are still a number of optimizations for &quot;&lt;tt&gt;lfs find -printf&lt;/tt&gt;&quot; that were not included in the original patch &lt;a href=&quot;https://review.whamcloud.com/45136&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/45136&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10378&quot; title=&quot;&amp;quot;lfs find&amp;quot; is missing &amp;quot;-printf&amp;quot; support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10378&quot;&gt;&lt;del&gt;LU-10378&lt;/del&gt;&lt;/a&gt; utils: add formatted printf to lfs find&lt;/tt&gt;&quot; landing that should still be addressed:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;selective fetching of metadata attributes.  In particular, fetching the projid for a file requires an extra syscall that is unnecessary if the projid is not being printed, at least until &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12480&quot; title=&quot;add STATX_PROJID to upstream kernel&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12480&quot;&gt;LU-12480&lt;/a&gt; is implemented.  Most of the other MDT attributes are &quot;free&quot; once &lt;b&gt;any&lt;/b&gt; attribute is read for a file, so it probably doesn&apos;t make sense to micro-optimize here.&lt;/li&gt;
	&lt;li&gt;pre-parsing of the &lt;tt&gt;-printf&lt;/tt&gt; argument string (assuming this actually shows up in the CPU profile, I&apos;m not sure if it is actually important vs. stat/RPC overhead)&lt;/li&gt;
	&lt;li&gt;maybe others, I didn&apos;t catch all of them&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="70232">LU-15837</key>
            <summary>&quot;lfs find -printf&quot; improvements</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="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>
                            <label>easy</label>
                            <label>lad23dd</label>
                            <label>lug23dd</label>
                    </labels>
                <created>Tue, 10 May 2022 20:23:31 +0000</created>
                <updated>Mon, 23 Oct 2023 15:28:12 +0000</updated>
                                            <version>Lustre 2.15.0</version>
                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="370208" author="adilger" created="Fri, 21 Apr 2023 22:31:58 +0000"  >&lt;p&gt;It looks like a few additional &lt;tt&gt;-printf&lt;/tt&gt; options should be implemented, but nothing overly complex.  These would be useful by themselves, and also to implement &quot;&lt;tt&gt;lfs find -ls&lt;/tt&gt;&quot;:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%i&lt;/tt&gt;&quot; - inode number&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%LF&lt;/tt&gt;&quot; - Lustre FID&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%k&lt;/tt&gt;&quot; - file blocks in kilobytes (should be trivial, just &quot;&lt;tt&gt;%b&lt;/tt&gt;/2&quot;)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%M&lt;/tt&gt;&quot; - symbolic file access mode (decode file type (&lt;tt&gt;-bcdls+/-rwxSt&lt;/tt&gt; UGO permission bits)&lt;/li&gt;
	&lt;li&gt;&lt;del&gt;&quot;&lt;tt&gt;%n&lt;/tt&gt;&quot; - link count&lt;/del&gt; (&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7495&quot; title=&quot;lfs find is missing &amp;quot;-links&amp;quot; support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7495&quot;&gt;&lt;del&gt;LU-7495&lt;/del&gt;&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%u&lt;/tt&gt;&quot; - username (could be mapped to &quot;&lt;tt&gt;%U&lt;/tt&gt;&quot; initially to print numeric UID, and implemented separately)&lt;/li&gt;
	&lt;li&gt;&quot;&lt;tt&gt;%g&lt;/tt&gt;&quot; - groupname (use &quot;&lt;tt&gt;%g&lt;/tt&gt;&quot; initially, as with &quot;&lt;tt&gt;%u&lt;/tt&gt;&quot;)&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="371690" author="adilger" created="Tue, 9 May 2023 18:41:30 +0000"  >&lt;p&gt;Looking at the strace output for regular file processing it seems like it is doing far too much for most files:&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;# strace -ttt -T lfs find /mnt/testfs/dir
:
:
1683657120.708615 getdents(4, /* 102 entries */, 32768) = 6448 &amp;lt;0.000784&amp;gt;
1683657120.709513 ioctl(4, _IOC(_IOC_READ|_IOC_WRITE, 0x69, 0x16, 0x140), 0xea2040) = 0 &amp;lt;0.002730&amp;gt;
1683657120.712309 open(&quot;/mnt/testfs/dir/filename_is_long-15&quot;, O_RDONLY) = 3 &amp;lt;0.003517&amp;gt;
1683657120.715904 ioctl(3, _IOC(_IOC_READ, 0x66, 0xaf, 0x4), 0x7ffc0a9b3ba0) = 0 &amp;lt;0.000140&amp;gt;
1683657120.716106 ioctl(3, FS_IOC_FSGETXATTR, 0x7ffc0a9b37d0) = 0 &amp;lt;0.000044&amp;gt;
1683657120.716243 newfstatat(4, &quot;filename_is_long-15&quot;, {st_mode=S_IFREG|0644, st_size=0, ...}, AT_SYMLINK_NOFOLLOW) = 0 &amp;lt;0.000683&amp;gt;
1683657120.717022 write(1, &quot;/mnt/testfs/dir/filename_is_long-15&quot;, 36) = 36 &amp;lt;0.000296&amp;gt; /mnt/testfs/dir/filename_is_long-15
1683657120.717386 close(3) = 0 &amp;lt;0.002073&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The &lt;tt&gt;ioctl(4, _IOC(_IOC_READ|_IOC_WRITE, 0x69, 0x16, 0x140) = IOC_MDC_GETFILEINFO_V2)&lt;/tt&gt; is expected for every file, since it gets the file layout and MDT attributes &lt;b&gt;from the parent directory&lt;/b&gt; but we definitely &lt;b&gt;should not&lt;/b&gt; be doing &lt;tt&gt;open()&lt;/tt&gt; and &lt;tt&gt;ioctl(FS_IOC_FSGETXATTR)&lt;/tt&gt; (to get projid) and &lt;tt&gt;newfstatat()&lt;/tt&gt; (not sure why?) on &lt;b&gt;every&lt;/b&gt; file when we are only printing the pathname.  That is a &lt;b&gt;lot&lt;/b&gt; of overhead (more than double the original &lt;tt&gt;ioctl(IOC_MDC_GETFILEINFO_V2)&lt;/tt&gt; call).&lt;/p&gt;

&lt;p&gt;Running without &lt;tt&gt;-printf &quot;%p&quot;&lt;/tt&gt; shows none of that overhead:&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;1683657295.265889 getdents(4, /* 102 entries */, 32768) = 6448 &amp;lt;0.000393&amp;gt;
1683657295.266362 write(1, &quot;/mnt/testfs/dir/filename_is_long-15&quot;..., 36) = 36 &amp;lt;0.000009&amp;gt; /mnt/testfs/dir/filename_is_long-15
1683657295.266446 write(1, &quot;/mnt/testfs/dir/filename_is_long-44&quot;..., 36) = 36 &amp;lt;0.000009&amp;gt; /mnt/testfs/dir/filename_is_long-44
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                            <comment id="372021" author="adilger" created="Thu, 11 May 2023 21:59:53 +0000"  >&lt;p&gt;I&apos;m thinking that &quot;gather_all&quot; should be changed to be a &lt;tt&gt;STATX_&lt;/tt&gt; bitmask to indicate which fields are needed, and then the code could be changed to check the bitmask when  the attributes are being fetched:&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;
#ifndef STATX_PROJID
#define STATX_PROJID 0x40000000 &lt;span class=&quot;code-comment&quot;&gt;/* only used internally */&lt;/span&gt;
#endif

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (param-&amp;gt;fp_check_projid || gather_printf &amp;amp; STATX_PROJID)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The definition of &lt;tt&gt;STAX_PROJID&lt;/tt&gt; would only be used internally until the kernel could itself return projid as part of &lt;tt&gt;statx()&lt;/tt&gt; (&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12480&quot; title=&quot;add STATX_PROJID to upstream kernel&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12480&quot;&gt;LU-12480&lt;/a&gt;).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="25084">LU-5170</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="56210">LU-12480</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="68412">LU-15504</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="69732">LU-15743</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="33365">LU-7495</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="49717">LU-10378</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75926">LU-16798</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="74700">LU-16560</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75966">LU-16808</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="78531">LU-17219</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75670">LU-16760</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75926">LU-16798</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|i02pjb:</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>