<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:39: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-10946] add an interface to load ldiskfs block bitmaps</title>
                <link>https://jira.whamcloud.com/browse/LU-10946</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;During our benchmarking/testing, we found sometimes write performances are not stable enough and there are some small read during write which could drop thoughoutput of write performances.&lt;/p&gt;

&lt;p&gt;It turned out that block bitmaps load make some latency here, also for a heavy fragment filesystem, we might need load many bitmaps to find some free blocks.&lt;/p&gt;

&lt;p&gt;To improve above situation, we had a patch to load block bitmaps to memory and pin those bitmaps memory until unmount or we release the memory on purpose, this could stable write performances and improve performances of a heavy fragment filesystem.&lt;/p&gt;</description>
                <environment></environment>
        <key id="51954">LU-10946</key>
            <summary>add an interface to load ldiskfs block bitmaps</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="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="wshilong">Wang Shilong</assignee>
                                    <reporter username="wangshilong">Wang Shilong</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Tue, 24 Apr 2018 14:32:27 +0000</created>
                <updated>Thu, 28 Sep 2023 02:53:15 +0000</updated>
                            <resolved>Mon, 20 Apr 2020 01:34:32 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>12</watches>
                                                                            <comments>
                            <comment id="226622" author="wangshilong" created="Tue, 24 Apr 2018 14:34:21 +0000"  >&lt;p&gt;I need cleanup our internal patch a bit, will push the patch to master very soon.&lt;/p&gt;</comment>
                            <comment id="226668" author="pjones" created="Tue, 24 Apr 2018 21:45:52 +0000"  >&lt;p&gt;ok - thanks &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=wangshilong&quot; class=&quot;user-hover&quot; rel=&quot;wangshilong&quot;&gt;wangshilong&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="226671" author="ndauchy" created="Tue, 24 Apr 2018 22:28:58 +0000"  >&lt;p&gt;This feature is of interest to NASA. (We currently use scripts around debugfs run periodically from cron to dump the bitmap information, and also the object trees with &apos;debugfs -c -R &quot;ls O/0/d$i&quot;&apos;.)&lt;/p&gt;

&lt;p&gt;I found this was discussed way back in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15&quot; title=&quot;strange slow IO messages and bad performance &quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15&quot;&gt;&lt;del&gt;LU-15&lt;/del&gt;&lt;/a&gt;, with memory requirement estimates (are they still valid?):&lt;br/&gt;
 &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15&quot; title=&quot;strange slow IO messages and bad performance &quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15&quot;&gt;&lt;del&gt;LU-15&lt;/del&gt;&lt;/a&gt; &lt;a href=&quot;#comment-12883&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot;&gt;comment-12883&lt;/a&gt;&lt;br/&gt;
 Also from ticket &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3631&quot; title=&quot;file stats are slow on filesystem start up&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3631&quot;&gt;&lt;del&gt;LU-3631&lt;/del&gt;&lt;/a&gt; is reading the inode bitmaps no longer really useful?&lt;/p&gt;

&lt;p&gt;Regarding this patch, I think it would be helpful to include options to make it more generally configurable and usable for a wider variety of use-cases, not just pin block bitmaps. For example...&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Just do a pre-read of the bitmaps to warm the cache, without pinning.&lt;/li&gt;
	&lt;li&gt;An option to either load at mount time, or load on demand.&lt;/li&gt;
	&lt;li&gt;Differentiate between loading (and pinning) Data Block bitmap vs. Inode bitmap vs. the full Inode Table.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thanks!&lt;/p&gt;</comment>
                            <comment id="226678" author="wangshilong" created="Tue, 24 Apr 2018 23:50:16 +0000"  >&lt;p&gt;Hi Nathan Dauchy,&lt;/p&gt;

&lt;p&gt;   Thanks for your input here, looks you raised a lot of interesting question here. &lt;sup&gt;_&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;1)regarding memory requirement, yup, there will be memory pressure for pinning bitmaps.&lt;br/&gt;
just considering we have one block bitmap(4K) vs a 128M block group, it might eat a lot&lt;br/&gt;
of memory if system is big. and same requirement for inode bitmap. I guess system memory&lt;br/&gt;
might not be enough to pin both inode bitmap and block bitmaps.&lt;/p&gt;

&lt;p&gt;2)we tried to just read bitmaps to memory and make it reclaimable but write performances&lt;br/&gt;
still not stable since those bitmap memory reclaimed easier before we want it.&lt;/p&gt;

&lt;p&gt;3)I don&apos;t think it a good idea to load(pin) full inode table, since full inode table eat much more memory&lt;br/&gt;
than bitmaps..maybe some on-demand load inode table ahead makes sense, which I am not sure.&lt;/p&gt;

&lt;p&gt;So I agreed we can make the patch more configurable with:&lt;br/&gt;
1)pre-read of bitmap to warm the cache without pinning.&lt;br/&gt;
2)option to pin bitmap&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Shilong&lt;/p&gt;</comment>
                            <comment id="226682" author="ndauchy" created="Wed, 25 Apr 2018 03:18:39 +0000"  >&lt;p&gt;Discussions of this at LUG brought up another issue, and possible solution... for cases of failover pairs, a server may have enough memory for pinning bitmaps in normal operation but OOM in a failover event with 2X the OST count.&#160; To handle that case, and protect low-memory OSS in general, there could also be a configurable amount (80% by default?) of total memory threshold above which not to pin bitmaps.&#160; I don&apos;t know if it would be better to pin as much as possible up to that threshold, or to pre-calculate whether all bitmaps for a given OST are pinnable based on total (or free) memory; but either way it should report a kernel error message if not able to pin without going over.&lt;/p&gt;</comment>
                            <comment id="226842" author="ndauchy" created="Thu, 26 Apr 2018 21:48:33 +0000"  >&lt;p&gt;For clarification on the metadata pre-loading done at NASA, I have uploaded the scripts.&#160; They are run from cron like:&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;0 1   * * * root /usr/local/bin/read-meta.sh dump &amp;gt;&amp;gt; /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/log/lustre-read-meta.log 2&amp;gt;&amp;amp;1
*/15 * * * * root /usr/local/bin/read-meta.sh read &amp;gt;&amp;gt; /&lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt;/log/lustre-read-meta.log 2&amp;gt;&amp;amp;1
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The original developer has left, but it sounds like the scripts were actually created with a focus on caching inode information (such as to speed up &quot;ls -l&quot;), not necessarily free blocks.  Perhaps they have the nice side effect of refreshing the block bitmaps in cache, and if other changes in the last few years like flex_bg have improved inode table reading, then these scripts are now unnecessary?&lt;/p&gt;</comment>
                            <comment id="227133" author="adilger" created="Wed, 2 May 2018 18:33:34 +0000"  >&lt;p&gt;Shilong, any progress on this patch?&lt;/p&gt;</comment>
                            <comment id="227413" author="wangshilong" created="Mon, 7 May 2018 08:59:35 +0000"  >&lt;p&gt;Nathan Dauchy,&lt;/p&gt;

&lt;p&gt;    Attachment read-inode is bad format to read, so we might better figure out caching which kind of metadata exactly improved your performances?&lt;/p&gt;</comment>
                            <comment id="227419" author="ndauchy" created="Mon, 7 May 2018 14:59:52 +0000"  >&lt;p&gt;It is just a text file, perl script.&#160; The file simply uses line feed characters, but perhaps your editor (when no extension is present) is looking for carriage return too.&lt;/p&gt;</comment>
                            <comment id="227468" author="wangshilong" created="Mon, 7 May 2018 23:38:10 +0000"  >&lt;p&gt;Nathan,&lt;/p&gt;

&lt;p&gt;I mean when I downloaded the attachment it is hard for me to read it, it is something like following&lt;br/&gt;
is a bit messy code..&lt;/p&gt;


&lt;p&gt;#!/usr/bin/perl -w # $Header: /cvsroot/lustre-tools/src/read-inodes,v 1.2 2011/03/16 00:04:17 jrappley Exp $ use strict; use File::Basename; use Getopt::Long; use Pod::Usage; use POSIX qw(ceil); use Fcntl &apos;SEEK_SET&apos;; my $progname = basename $0; # Globals my $group = 0; my $inodesPerGroup = 0; my $inodeBlocksPerGroup = 0; my @usedInodes; my $freeIBlocks = 0; # Command line options my %arg; $arg&lt;/p&gt;
{verbose} = 0; sub dprint { if ($arg{verbose}
&lt;p&gt; &amp;gt; 1) &lt;/p&gt;
{ print @_; }
&lt;p&gt; } # Parse command line options Getopt::Long::Configure(&quot;bundling&quot;); GetOptions( &quot;h|help&quot; =&amp;gt; \$arg&lt;/p&gt;
{h}, &quot;d|device=s&quot; =&amp;gt; \$arg{device}, &quot;m|meta=s&quot; =&amp;gt; \$arg{meta}, &quot;v|verbose+&quot; =&amp;gt; \$arg{verbose}, ) or pod2usage(-exitval =&amp;gt; 2, -verbose =&amp;gt; 1); pod2usage(1) if ($arg{h}
&lt;p&gt;); pod2usage(1) if (scalar(@ARGV) &lt;span class=&quot;error&quot;&gt;Unable to render embedded object: File (= 0); pod2usage(1) if () not found.&lt;/span&gt; defined $arg&lt;/p&gt;
{meta}); if (defined $arg{device}) { open D, &quot;&amp;lt;&quot;, &quot;$arg{device}&quot; or die &quot;Couldn&apos;t open $arg{device}: $!&quot;; } open M, &quot;&amp;lt;&quot;, $arg{meta}
&lt;p&gt; or die &quot;Couldn&apos;t open $arg&lt;/p&gt;
{meta}
&lt;p&gt;: $!&quot;; while () { if (/Inodes per group:\s+(\d+)/) &lt;/p&gt;
{ $inodesPerGroup = $1; }
&lt;p&gt; elsif (/Inode blocks per group:\s+(\d+)/) &lt;/p&gt;
{ $inodeBlocksPerGroup = $1; }
&lt;p&gt; elsif (/^$/) &lt;/p&gt;
{ last; }
&lt;p&gt; } if ($inodesPerGroup == 0 || $inodeBlocksPerGroup == 0) &lt;/p&gt;
{ print STDERR &quot;Couldn&apos;t determine number of inodes per group, exiting\n&quot;; exit 1; }
&lt;p&gt; my $inodesPerBlock = $inodesPerGroup / $inodeBlocksPerGroup; my $firstItableBlock; while () { if (/^Group (\d+)/) &lt;/p&gt;
{ $group = $1; }
&lt;p&gt; if (/Inode table at (\d+)/) &lt;/p&gt;
{ $firstItableBlock = $1; }
&lt;p&gt; if (/(\d+) free inodes/) &lt;/p&gt;
{ $usedInodes[$group] = $inodesPerGroup - $1; }
&lt;p&gt; if (/Free inodes:\s(.*)/) { # next if $group &amp;gt; 1; my @usedIBlocks; my $groupFreeIBlocks = 0; for my $i (0..$inodeBlocksPerGroup - 1) &lt;/p&gt;
{ $usedIBlocks[$i] = $inodesPerBlock; }
&lt;p&gt; dprint &quot;$group: &quot;, join(&quot; &quot;, @usedIBlocks), &quot;\n&quot;; my @irange = split(/, /, $1); dprint &quot;Group $group: &quot;, join(&quot; X &quot;, @irange), &quot;\n&quot;; foreach my $range (@irange) { dprint &quot;range: $range\n&quot;; if ($range =~ /(\d+)-(\d+)/) { my $low = $1 - ($group * $inodesPerGroup); my $high = $2 - ($group * $inodesPerGroup); dprint &quot;marking $low..$high\n&quot;; for my $inum ($low..$high) &lt;/p&gt;
{ my $iBlock = ceil($inum / $inodesPerBlock) - 1; dprint &quot;inum $inum block $iBlock\n&quot;; $usedIBlocks[$iBlock]--; }
&lt;p&gt; } else &lt;/p&gt;
{ my $inum = $range - ($group * $inodesPerGroup); my $iBlock = ceil($inum / $inodesPerBlock) - 1; dprint &quot;marking $inum block $iBlock\n&quot;; $usedIBlocks[$iBlock]--; }
&lt;p&gt; } for my $i (0..$#usedIBlocks) { if ($usedIBlocks&lt;span class=&quot;error&quot;&gt;&amp;#91;$i&amp;#93;&lt;/span&gt; == 0) { $groupFreeIBlocks++; my $block = $firstItableBlock + $i; if (0) &lt;/p&gt;
{ dprint &quot;group $group read &quot;, $firstItableBlock + $i, &quot;\n&quot;; sysseek(D, $block * 4096, SEEK_SET); sysread(D, my $foo, 4096); }
&lt;p&gt; } elsif (defined $arg&lt;/p&gt;
{device}
&lt;p&gt;) &lt;/p&gt;
{ my $block = $firstItableBlock + $i; dprint &quot;group $group read &quot;, $firstItableBlock + $i, &quot;\n&quot;; sysseek(D, $block * 4096, SEEK_SET); sysread(D, my $foo, 4096); }
&lt;p&gt; } $freeIBlocks += $groupFreeIBlocks; my @blockStr = map &lt;/p&gt;
{ sprintf &quot;%3d&quot;, $_ }
&lt;p&gt; @usedIBlocks; if ($arg&lt;/p&gt;
{verbose}
&lt;p&gt;) &lt;/p&gt;
{ printf(&quot;%6d: %3d/%3d | %s\n&quot;, $group, $usedInodes[$group], $groupFreeIBlocks, join(&quot;&quot;, @blockStr)); }
&lt;p&gt; } } print &quot;Unused inode blocks: $freeIBlocks\n&quot;; close M; _&lt;em&gt;END&lt;/em&gt;_ =head1 NAME =head1 SYNOPSIS skeleton.pl &lt;span class=&quot;error&quot;&gt;&amp;#91;-h&amp;#93;&lt;/span&gt; =head1 DESCRIPTION =head1 OPTIONS =over 8 =item B&amp;lt;&lt;del&gt;h|&lt;/del&gt;-help&amp;gt; Print a help message and exit. =back 8 =head1 EXAMPLES =head1 ENVIRONMENT =over 8 =item B FOO is an environment variable that somehow alters the execution of this program. =back 8 =head1 KNOWN BUGS =head1 CAVEATS =head1 DETAILS =head1 REPORTING BUGS =head1 AUTHOR =head1 SEE ALSO&lt;/p&gt;

</comment>
                            <comment id="227612" author="gerrit" created="Thu, 10 May 2018 01:30:56 +0000"  >&lt;p&gt;Wang Shilong (wshilong@ddn.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32347&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32347&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10946&quot; title=&quot;add an interface to load ldiskfs block bitmaps&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10946&quot;&gt;&lt;del&gt;LU-10946&lt;/del&gt;&lt;/a&gt; ldiskfs: add an interface to load ldiskfs block bitmaps&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: f2989ee1ac1b7ca5666fc1cf42f9e95f3da20200&lt;/p&gt;</comment>
                            <comment id="227613" author="wangshilong" created="Thu, 10 May 2018 01:33:45 +0000"  >&lt;p&gt;Hi Nathan Dauchy,&lt;/p&gt;

&lt;p&gt;  Sorry for late patch, I just pushed a simple version, could you help test if it help your performance case?&lt;/p&gt;

&lt;p&gt;echo 1 &amp;gt; /sys/fs/ldiskfs/vdb/loadbbitmaps       # this is just load not pin.&lt;br/&gt;
echo 2 &amp;gt; /sys/fs/ldiskfs/vdb/loadbbitmaps       # pin block bitmaps in memory&lt;br/&gt;
echo 0 &amp;gt; /sys/fs/ldiskfs/vdb/loadbbitmaps       #unpin block bitmaps in memory&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Shilong&lt;/p&gt;</comment>
                            <comment id="227918" author="jaylan" created="Tue, 15 May 2018 22:10:32 +0000"  >&lt;p&gt;Hi Shilong,&lt;/p&gt;

&lt;p&gt;Nathan asked me to cherry-pick the #32347 review. This patch caused conflicts in b2_10. Branch b2_10 is 4 ldiskfs kernel_patches behind compared to master branch. Is there dependency on the 4 missing patches or any other commit? If yes, could you list prerequisites of your patch?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
 Jay&lt;/p&gt;</comment>
                            <comment id="228080" author="wangshilong" created="Thu, 17 May 2018 12:48:48 +0000"  >&lt;p&gt;Hi Jay Lan,&lt;/p&gt;

&lt;p&gt;      You could just ignore the 4 missing patches, and apply my patch directly, I build locally, it works.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Shilong&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="78166">LU-17153</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="52042">LU-10967</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="57389">LU-12970</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="30090" name="read-inodes" size="3792" author="ndauchy" created="Thu, 26 Apr 2018 21:40:57 +0000"/>
                            <attachment id="30089" name="read-meta.sh" size="1658" author="ndauchy" created="Thu, 26 Apr 2018 21:40:57 +0000"/>
                    </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|hzzw9z:</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>