<div dir="ltr">Hi,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 17, 2015 at 6:40 PM, Jan Stancek <span dir="ltr"><<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.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"><div><div><br>
<br>
</div></div>Hi,<br>
<br>
v3 looks OK to me, few nits are noted below:<br>
<br>
If you make "addr" "char *" one cast can go away.<br>
And from what I understand, important is to touch the page,<br>
so writing char instead of int should work too:<br>
  *(mmap_sz->addr + b * hpage_size) = rand();<br></blockquote><div> </div><div>yeah, that would be nice!<br> <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>
I tried the above and I could still trigger the panic.<br>
<span><br>
> +             }<br>
> +     }<br>
> +     return NULL;<br>
> +}<br>
> +<br>
> +void do_mmap(void)<br>
> +{<br>
> +     int i, sz;<br>
> +     void *addr, *new_addr;<br>
> +     struct mp mmap_sz[ARSZ];<br>
> +     pthread_t tid[ARSZ];<br>
> +<br>
> +     sz = ARSZ + 1;<br>
<br>
</span>This could go on same line where you declared sz.<br></blockquote><div> </div><div>ok.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div><br>
> +                             -1, 0);<br>
> +<br>
> +             if (new_addr == MAP_FAILED) {<br>
> +                     TEST(pthread_join(tid[i], NULL));<br>
<br>
</div></div>What is the purpose of pthread_join here?<br></blockquote><div><br></div><div>hmm, jut waiting for the latest thread to make process safe. but after thinking over, I feel it's meaningless to do that.  okay, thanks for pointing out, I can remove it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span><br>
> +                     if (TEST_RETURN)<br>
> +                             tst_brkm(TBROK | TRERRNO, cleanup,<br>
> +                                             "pthread_join failed");<br>
> +                     tst_brkm(TFAIL | TERRNO, cleanup, "mremap failed");<br>
<br>
</span>"mremap" looks like typo<br></blockquote><div> </div><div>yes.<br> <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>
Regards,<br>
Jan<br>
<div><div><br clear="all"></div></div></blockquote></div><br>thanks for your kind reply. patch V4 will be threw out.<br></div><div class="gmail_extra"><br>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Regards,<br></div>Li Wang<br></div><div>Email: <a href="mailto:liwang@redhat.com" target="_blank">liwang@redhat.com</a><br></div></div></div></div></div></div>
</div></div>