<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:19: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-8674] A lightweight internal policy engine of Lustre for HSM, OST pool migration, file heat, inotify and so on</title>
                <link>https://jira.whamcloud.com/browse/LU-8674</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Features of Lustre like HSM and OST pool based on SSD have enabled a lot of&lt;br/&gt;
new use cases, which makes data management of Lustre file system a new daily&lt;br/&gt;
work. The Robinhood Policy Engine is able to do various kinds of data&lt;br/&gt;
management based on pre-configured rules and has been confirmed as a versatile&lt;br/&gt;
tool to manage large Lustre file systems. However, using Robinhood requires&lt;br/&gt;
external machine with stronge CPU, memory and storage. And setuping and&lt;br/&gt;
configuring Robinhood properly requires extra efforts from users. That is why&lt;br/&gt;
we(DDN) are proposing a policy engine which is implemented completely inside&lt;br/&gt;
Lustre. In order to avoid performance regression and complexity, this policy&lt;br/&gt;
engine is implemented in a very lightweight way. That means, it can only&lt;br/&gt;
support a limited part of use cases, which might be much less than what&lt;br/&gt;
Robinhood can do. However, this new policy engine could still be useful for&lt;br/&gt;
a lot of use cases, especially for the ones which are relatively simpler.&lt;/p&gt;

&lt;p&gt;The core component of policy engine is an arithmetic unit which can calculate&lt;br/&gt;
the value of a rule that can be configured by users in run time. The rule is an&lt;br/&gt;
arithmetic expression. An expression is either 1) an number, or 2) a constant&lt;br/&gt;
name, or 3) a system attribute name, or 4) an object attribute name, or 5) two&lt;br/&gt;
expression that are combined together by an operator.&lt;/p&gt;

&lt;p&gt;The arithmetic values of all expressions are calculated as unsigned 64 bit&lt;br/&gt;
number, so all unsigned 64 bit numbers can be used in the expression. &lt;/p&gt;

&lt;p&gt;A constant name is only an alias of an 64 bit number, which should already&lt;br/&gt;
been pre-defined in Lustre codes. The value of the constant, thus, is already&lt;br/&gt;
been pre-defined. An typical rule for HSM might use constants hsma_bit_[&lt;br/&gt;
archive|restore|remove|cancel] to indicate the HSM actions that&lt;br/&gt;
should be taken after evaluating the rule.&lt;/p&gt;

&lt;p&gt;A system attribute is the system wide attribute of Lustre or the kernel. The&lt;br/&gt;
free space is an typical example of system state on OST. And free inode number&lt;br/&gt;
on MDT is another example. Date time is an example of the system attribute&lt;br/&gt;
which is independent of Lustre. When evaluating the value of the expression,&lt;br/&gt;
the value of the system attribute will be used. And since the arithmetic value&lt;br/&gt;
is 64 bit, all the attribute values will be 64 bit numbers.&lt;/p&gt;

&lt;p&gt;An object attribute name could be any attribute name that is available from&lt;br/&gt;
the corresponding Lustre objects, usually MDT objects and OST objects.&lt;br/&gt;
Avaliable object attribute names include but not limited to the attributes&lt;br/&gt;
that can be read by getattr() syscall, such as atime, mtime, ctime, size,&lt;br/&gt;
mode, uid, gid, blocks, type, flags, nlink, rdev, blksize, etc.&lt;/p&gt;

&lt;p&gt;An operator could be almost any integer operations that can be used in C&lt;br/&gt;
language, including arithmetic operators (+, -, *, /, %), relational and&lt;br/&gt;
logical operators (==, !=, &amp;gt;, &amp;gt;=, &amp;lt;, &amp;lt;=), and bitwise operators\&lt;br/&gt;
(&amp;amp;, |, ^, &amp;lt;&amp;lt;, &amp;gt;&amp;gt;).&lt;/p&gt;

&lt;p&gt;In order to simplify the parsing of the expression in Lustre, the expression&lt;br/&gt;
of the rule should be configured in the form of Polish notation&lt;br/&gt;
(&lt;a href=&quot;https://en.wikipedia.org/wiki/Polish_notation&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://en.wikipedia.org/wiki/Polish_notation&lt;/a&gt;). An rule that will trigger&lt;br/&gt;
HSM archive action if the modify timestamp of the file is 1 minute ealier than&lt;br/&gt;
the system time could be set by the following command:&lt;/p&gt;

&lt;p&gt;echo -n &quot;&amp;amp; - &amp;gt;= mtime - sys_time 60 1 hsma_bit_archive&quot; &amp;gt; /proc/fs/lustre/mdt/lustre-MDT0000/hsm_policy_rule&lt;/p&gt;

&lt;p&gt;Currently, no optimization of the expression will be done by Lustre when being&lt;br/&gt;
set, even the way to optimize it is obvious. For example, &quot;&amp;amp;&amp;amp; 0 expression1&quot; is&lt;br/&gt;
essentially equal to &quot;0&quot;, however, the value of &quot;expression1&quot; will still be&lt;br/&gt;
evaluated when getting the value of the entire expression. That means, before&lt;br/&gt;
setting the expression rule, it should be optimized either manually or through&lt;br/&gt;
external tool. An external userspace tool which can transfer normal notation&lt;br/&gt;
with parenthesis to Polish notation and at the same time optimize the&lt;br/&gt;
expression could be really helpful for the users.&lt;/p&gt;

&lt;p&gt;The configured rule could be evaluated either synchronously or asynchronously.&lt;br/&gt;
Synchronous evaluation means to evaluate the expression in the context of a&lt;br/&gt;
service thread. For example, when a file is being accessed, the expression of&lt;br/&gt;
the rule will be calculated in the service thread. Corresponding actions will&lt;br/&gt;
be triggered by the policy engine if the value of the expression matches a&lt;br/&gt;
predefined pattern. In order to avoid performance regression, the speed of&lt;br/&gt;
the synchronous evaluation is ciritial. And that is the reason why only one&lt;br/&gt;
rule is supported by synchronous evaluation.&lt;/p&gt;

&lt;p&gt;However, after synchronous evaluation triggers action job, asynchronous&lt;br/&gt;
evaluation could be done on multiple pre-configured rules when handling&lt;br/&gt;
the action job. Asynchrouse evaluation is done in a dedicated thread pool&lt;br/&gt;
of policy engine so no performance regression will be caused by asynchrous&lt;br/&gt;
evaluation. And the service thread pool could scan the whole OST/MDT from&lt;br/&gt;
time to time to find the objects that match the rules.&lt;/p&gt;

&lt;p&gt;A set of rules like &quot;condition1 -&amp;gt; action1&quot;, &quot;condition2 -&amp;gt; action2&quot;,&lt;br/&gt;
and &quot;condition3 -&amp;gt; action3&quot; could be configured to asynchronous evaluation&lt;br/&gt;
of policy engine. And in order to trigger job properly by synchronous&lt;br/&gt;
evaluation, a rule that equal to but more optimized than&lt;br/&gt;
&quot;|| condition1 || condition2 condition3&quot; should be set.&lt;/p&gt;

&lt;p&gt;Obviously, this policy engine has some limitations. And all the things that&lt;br/&gt;
this policy engine could do on HSM should be able be accomplished by using&lt;br/&gt;
Robinhood.&lt;/p&gt;

&lt;p&gt;Even though the current codes only have HSM support, this policy engine could&lt;br/&gt;
be potentially used for other features which need configurable policies.&lt;br/&gt;
Following is a list of the features:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Data migration between SSD OST pool and normal OST pool. The policy engine&lt;br/&gt;
could use a new feature named file heat to decide which data to move to SSD&lt;br/&gt;
pool.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;RPC classfication in NRS TBF policy. Currently, NRS TBF policy classify RPCs&lt;br/&gt;
based on NID/JobID. By using the expression of this policy engine, the TBF&lt;br/&gt;
policy could classify RPCs based on an expression of RPC attributes which can&lt;br/&gt;
be configured by users. This could enable much more use cases than existing&lt;br/&gt;
classfication.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Inotify is a useful feature when montoring the events of file systems. But&lt;br/&gt;
Lustre itself doesn&apos;t support system wide inotify. By using the lightweight&lt;br/&gt;
policy engine, a notification mechanism that might be more powerful and&lt;br/&gt;
efficient than inotify could be implemented for Lustre. In order to act like&lt;br/&gt;
inotify, when the pre-configured rule is matched, instead of applying&lt;br/&gt;
background actions, this policy engine could send a notification to the&lt;br/&gt;
watching application. Because an expression could be used to filter the&lt;br/&gt;
desired events from the original source, the extra overhead such as RPCs&lt;br/&gt;
caused by notification could be minimized.&lt;/li&gt;
&lt;/ul&gt;


&lt;ul&gt;
	&lt;li&gt;Cache management tuning on different levels. The policy engine could be used&lt;br/&gt;
in cache management systems in order to make the decision of data prefetching&lt;br/&gt;
or cache eviction.&lt;/li&gt;
&lt;/ul&gt;
</description>
                <environment></environment>
        <key id="40348">LU-8674</key>
            <summary>A lightweight internal policy engine of Lustre for HSM, OST pool migration, file heat, inotify and so on</summary>
                <type id="2" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11311&amp;avatarType=issuetype">New Feature</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="1">Fixed</resolution>
                                        <assignee username="lixi">Li Xi</assignee>
                                    <reporter username="lixi">Li Xi</reporter>
                        <labels>
                            <label>cea</label>
                    </labels>
                <created>Fri, 7 Oct 2016 08:47:20 +0000</created>
                <updated>Fri, 2 Jun 2017 19:54:00 +0000</updated>
                            <resolved>Fri, 2 Jun 2017 19:54:00 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>16</watches>
                                                                            <comments>
                            <comment id="168639" author="gerrit" created="Fri, 7 Oct 2016 08:56:40 +0000"  >&lt;p&gt;Li Xi (lixi@ddn.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/23014&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/23014&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8674&quot; title=&quot;A lightweight internal policy engine of Lustre for HSM, OST pool migration, file heat, inotify and so on&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8674&quot;&gt;&lt;del&gt;LU-8674&lt;/del&gt;&lt;/a&gt; obd: Add a general policy engine&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: d6add7688c92d3ac6be218cc14e29977c49b73d9&lt;/p&gt;</comment>
                            <comment id="168657" author="pjones" created="Fri, 7 Oct 2016 13:02:35 +0000"  >&lt;p&gt;Thanks for the suggestion Li Xi&lt;/p&gt;</comment>
                            <comment id="197934" author="lixi" created="Fri, 2 Jun 2017 19:54:00 +0000"  >&lt;p&gt;I am closing this because user-space policy engine looks much flexible than this.&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|hzyqsf:</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>