<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Cyril Hrubis <<a href="mailto:chrubis@suse.cz">chrubis@suse.cz</a>> wrote:<br></div></div><div class="gmail_quote"><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> +TST_FLEXIBLE:<br>
> + If set non-zero number in .request_hugepages, ltp will try to reserve the<br>
> + expected number of hugepage for testing in setup phase. If system does not<br>
> + have enough memory for that, it will try the best to reserve 80% available<br>
> + huge pages.<br>
> +<br>
> +TST_ENFORCED:<br>
> + This is an enforced requirement for huge page reserve, ltp should strictly do<br>
> + hpages applying and guarantee the 'HugePages_Free' no less than specified pages<br>
> + which gives that test can use these specified numbers correctly.<br>
<br>
As for the naming I would probably go for TST_NEEDS and TST_REQUEST. We<br>
use the word 'needs' in the tst_test to describe something that is<br>
required for the test. And 'request' sounds better to me than flexible<br>
in a sense that you can request a lot but get less than what was<br>
requested.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Sounds better, if so, I'd also rename '.request_hugepages' to '.hugepages'</div><div><div class="gmail_default">in tst_test because there have been overlaps in the tst_policy words.</div></div><div><div class="gmail_default"><br></div> struct tst_test test = {<br> .test_all = run,<br>- .request_hugepages = 2,<br>+ .hugepages = {2, TST_REQUEST},<br> ...<br> };<br><div class="gmail_default"></div><div class="gmail_default">No hugepage change to:</div><div class="gmail_default"><br></div><div class="gmail_default"> .hugepages = {TST_NO_HUGEPAGES, TST_REQUEST},<br></div><div class="gmail_default"><br></div><div class="gmail_default">API in header file change to:</div><div class="gmail_default"><br></div><div class="gmail_default">-unsigned long tst_request_hugepages(unsigned long hpages);<br></div></div><div class="gmail_default" style="font-size:small">+unsigned long tst_reserve_hugepages(struct tst_hugepage *hp);</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> - unsigned long request_hugepages;<br>
> + struct tst_hugepage *request_hugepages;<br>
<br>
Why is this treated as an array even though we work with only single<br>
struct tst_hugepage instance?<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Right, it no needs an array in that case.</div></div><div><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>