<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 2, 2020 at 10:10 AM Yang Xu <<a href="mailto:xuyang2018.jy@cn.fujitsu.com">xuyang2018.jy@cn.fujitsu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
Hi Li<br>
> To avoid FS deferred IO metadata/cache interferes test result, so we<br>
> do sync simply before the tst_dev_bytes_written invocation.<br>
> <br>
Looks good, acked. Also, I think we can mention it in <br>
doc/test-writing-guidelines.txt when using this api.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Ok, I will append one line as:</div><div class="gmail_default" style="font-size:small"></div><div class="gmail_default" style="font-size:small">--- a/doc/test-writing-guidelines.txt<br>+++ b/doc/test-writing-guidelines.txt<br>@@ -1072,7 +1072,9 @@ unsigned long tst_dev_bytes_written(const char *dev);<br> -------------------------------------------------------------------------------<br> <br> This function reads test block device stat file (/sys/block/<device>/stat) and<br>-returns the bytes written since the last invocation of this function.<br>+returns the bytes written since the last invocation of this function. To avoid<br>+FS deferred IO metadata/cache interferes the test result, we suggest doing sync()<br>+before the tst_dev_bytes_written first invocation.<br></div><div class="gmail_default" style="font-size:small"><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>