<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 6/5/18 12:33 AM, Li Wang wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEemH2c5H+gL1mPFyGcBA0__bJXCf6J4vQ4-xZwFSG5Mp4cjqw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Hi Yang,<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">Yang Shi <span dir="ltr"><<a
href="mailto:yang.shi@linux.alibaba.com" target="_blank"
moz-do-not-send="true">yang.shi@linux.alibaba.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Due to upstream kernel
commit a983b5ebee57209c99f68c8327072f<wbr>25e0e6e3da<br>
("mm: memcontrol: fix excessive complexity in memory.stat
reporting"),<br>
memory.stat is updated in a batch of 33 pages. This
results in some test<br>
cases fail at checking stat counter since they just touch
one page.<br>
<br>
Introduce TST_PAGESIZE, which is 33 * PAGESIZE, used by
affected test<br>
cases, keep others still use PAGESIZE. And, this change
doesn't break<br>
pre-4.16 kernel.<br>
<br>
Signed-off-by: Yang Shi <<a
href="mailto:yang.shi@linux.alibaba.com"
moz-do-not-send="true">yang.shi@linux.alibaba.com</a>><br>
---<br>
testcases/kernel/controllers/<wbr>memcg/functional/memcg_lib.sh
| 13 ++++++++-----<br>
.../functional/memcg_move_<wbr>charge_at_immigrate_test.sh
| 14 +++++++-------<br>
.../kernel/controllers/memcg/<wbr>functional/memcg_stat_rss.sh
| 12 ++++++------<br>
.../kernel/controllers/memcg/<wbr>functional/memcg_stat_test.sh
| 6 +++---<br>
4 files changed, 24 insertions(+), 21 deletions(-)<br>
<br>
diff --git a/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh
b/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
index 6a6af85..ad6db24 100755<br>
--- a/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
+++ b/testcases/kernel/<wbr>controllers/memcg/functional/<wbr>memcg_lib.sh<br>
@@ -34,6 +34,9 @@ if [ $? -ne 0 ]; then<br>
tst_brkm TBROK "getconf PAGESIZE failed"<br>
fi<br>
<br>
+# Post 4.16 kernel updates stat in batch (> 32 pages)
every time<br>
+TST_PAGESIZE=$(( $PAGESIZE * 33 ))</blockquote>
<div><br>
</div>
</div>
<div class="gmail_default" style="font-size:small">AFAIK, LTP
always reserve the ‘TST_’ prefix for general-purpose library<br>
using, so we'd better avoid this in testcase variable
naming.<br>
<br>
</div>
<div class="gmail_default" style="font-size:small">What about
replacing it by PAGESIZES or PAGESIZE_NUM?</div>
</div>
</div>
</blockquote>
<br>
"PAGESIZES" looks reasonable. Thanks for the suggestion. Will fix in
v2.<br>
<br>
Yang<br>
<br>
<blockquote type="cite"
cite="mid:CAEemH2c5H+gL1mPFyGcBA0__bJXCf6J4vQ4-xZwFSG5Mp4cjqw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra"><br>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>Regards,<br>
</div>
<div>Li Wang<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>