<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:25:46 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-16298] periodically write ldiskfs superblock</title>
                <link>https://jira.whamcloud.com/browse/LU-16298</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The ext4 superblock has an &quot;&lt;tt&gt;s_kbytes_written&lt;/tt&gt;&quot; field that is supposed to contain the total number of bytes written to the block device since the filesystem was formatted.  The in-memory counter that tracks the current number of writes written to the block device is exposed to userspace via &lt;tt&gt;/sys/fs/{ldiskfs,ext4}/&amp;lt;device&amp;gt;/session_kbytes_written&lt;/tt&gt;, and this is added to &lt;tt&gt;s_kbytes_written&lt;/tt&gt; to generate the &quot;lifetime&quot; writes and shown at &lt;tt&gt;.../lifetime_kbytes_written&lt;/tt&gt;.  This would be useful for tracking the total lifetime writes on flash OST and MDT devices, assuming they are not reformatted during usage (which should be rare).  The in-memory block device writes counter is written to disk via &lt;tt&gt;ext4_update_super()&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;Unfortunately, upstream ext4 after commit &lt;a href=&quot;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4d47603d9703e6fff8ff2618bc108d6280e2439d&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;v3.5-rc5-19-g4d47603d9703&lt;/a&gt; no longer writes out the superblock on any regular basis.  The superblock is only written at unmount/remount time, in case &lt;tt&gt;ext4_error()&lt;/tt&gt; is hit, or if the filesystem is resized or frozen, which means that the &lt;tt&gt;s_kbytes_written&lt;/tt&gt; counter may frequently be inaccurate due to missing updates if the filesystem is not unmounted cleanly each time (e.g. due to crash/reboot/STONITH).&lt;/p&gt;

&lt;p&gt;Having a periodic write of the superblock (e.g. once per hour, or other tunable interval) would not add any measurable overhead to the system, but ensure that the &lt;tt&gt;s_kbytes_written&lt;/tt&gt; counter is kept relatively well updated, so at most an hour worth of writes would be lost in case of a crash and remount.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="73103">LU-16298</key>
            <summary>periodically write ldiskfs superblock</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="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="vkuznetsov">Vitaliy Kuznetsov</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>ldiskfs</label>
                    </labels>
                <created>Thu, 3 Nov 2022 20:31:40 +0000</created>
                <updated>Mon, 28 Aug 2023 16:13:09 +0000</updated>
                            <resolved>Wed, 19 Jul 2023 17:22:04 +0000</resolved>
                                                    <fixVersion>Lustre 2.16.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="351708" author="adilger" created="Thu, 3 Nov 2022 20:53:54 +0000"  >&lt;p&gt;Implementation notes:&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;calling &lt;tt&gt;ext4_update_super()&lt;/tt&gt; also has the added benefit that the superblock &lt;tt&gt;s_free_inodes_count&lt;/tt&gt; and &lt;tt&gt;s_free_blocks_count&lt;/tt&gt; fields are updated on disk&lt;/li&gt;
	&lt;li&gt;there are separate &lt;tt&gt;s_kbytes_written&lt;/tt&gt; values for the on-disk superblock and in-memory superblock&lt;/li&gt;
	&lt;li&gt;before writing the superblock to disk, only the on-disk superblock value should be updated, so that the amount is not double-counted in &lt;tt&gt;lifetime_kbytes_written&lt;/tt&gt;.  this is already handled correctly by &lt;tt&gt;ext4_update_super()&lt;/tt&gt;&lt;/li&gt;
	&lt;li&gt;the write should be skipped if the number of bytes written is very small (e.g. under 16MB) so that the superblock write itself does not spin up a sleeping disk&lt;/li&gt;
	&lt;li&gt;it might be possible to have a regular check (e.g. in journal commit if (&lt;tt&gt;now - s_wtime&lt;/tt&gt;) &amp;gt; interval) to trigger the superblock write, to ensure that it is written only while the disk is active, rather than on a timer that may trigger when the disk is idle.&lt;/li&gt;
	&lt;li&gt;using &lt;tt&gt;s_wtime&lt;/tt&gt; for the interval check (with &lt;tt&gt;ext4_get_tstamp()&lt;/tt&gt;) is also convenient, since that is updated in &lt;tt&gt;ext4_update_super&lt;/tt&gt; at the same time the counters are written to disk&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="375683" author="gerrit" created="Fri, 16 Jun 2023 15:22:49 +0000"  >&lt;p&gt;&quot;Vitaliy Kuznetsov &amp;lt;vkuznetsov@ddn.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/51340&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/51340&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16298&quot; title=&quot;periodically write ldiskfs superblock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16298&quot;&gt;&lt;del&gt;LU-16298&lt;/del&gt;&lt;/a&gt; ldiskfs: Periodically write ldiskfs superblock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 018987285af2c40f9fcb1a0008e5d9283658dd7d&lt;/p&gt;</comment>
                            <comment id="379342" author="gerrit" created="Wed, 19 Jul 2023 16:42:23 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/51340/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/51340/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16298&quot; title=&quot;periodically write ldiskfs superblock&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16298&quot;&gt;&lt;del&gt;LU-16298&lt;/del&gt;&lt;/a&gt; ldiskfs: Periodically write ldiskfs superblock&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: e27a7b33d6351ff8b8bae101079af88f4eedac99&lt;/p&gt;</comment>
                            <comment id="379376" author="pjones" created="Wed, 19 Jul 2023 17:22:04 +0000"  >&lt;p&gt;Landed for 2.16&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="77144">LU-16982</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|i034rb:</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>