<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Tobias,<br>
    <br>
    <div class="moz-cite-prefix">On 10/07/2014 03:08 PM, Tobias Hartmann
      wrote:<br>
    </div>
    <blockquote cite="mid:5433E5EB.7020206@oracle.com" type="cite">Hi
      Albert,
      <br>
      <br>
      thanks for the review.
      <br>
      <br>
      On 07.10.2014 13:16, Albert Noll wrote:
      <br>
      <blockquote type="cite">Hi Tobias,
        <br>
        <br>
        would it also work to check the state of the nmethod before
        calling
        <br>
        make_zombie?
        <br>
        <br>
        if (nm->is_not_entrant()) {
        <br>
           nm->make_zombie()
        <br>
        }
        <br>
      </blockquote>
      <br>
      Yes, regarding Mikael's comment, that is a better solution.
      <br>
      <br>
      <blockquote type="cite">In any case, it would be nice the have a
        comment that explains why we
        <br>
        should not enter a
        <br>
        safpoint / have to do the extra check as described above.
        <br>
      </blockquote>
      <br>
      I changed the fix accordingly and added an additional comment. I
      also moved the statistics/debugging code such that it is only
      executed if the sweeper sets the nmethod to zombie.
      <br>
      <br>
      New webrev:
      <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~thartmann/8059735/webrev.01/">http://cr.openjdk.java.net/~thartmann/8059735/webrev.01/</a>
      <br>
    </blockquote>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    I have one additional question. Do we need to hold the
    "CompiledIC_lock" when<br>
    we call make_zombie()?<br>
    <br>
    Best,<br>
    Albert<br>
    <br>
    <blockquote cite="mid:5433E5EB.7020206@oracle.com" type="cite">Thanks,
      <br>
      Tobias
      <br>
      <br>
      <blockquote type="cite">
        <br>
        Best,
        <br>
        Albert
        <br>
        <br>
        <br>
        On 10/07/2014 01:03 PM, Tobias Hartmann wrote:
        <br>
        <blockquote type="cite">Hi,
          <br>
          <br>
          please review the following patch.
          <br>
          <br>
          Bug: <a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8059735">https://bugs.openjdk.java.net/browse/JDK-8059735</a>
          <br>
          Webrev:
          <a class="moz-txt-link-freetext" href="http://cr.openjdk.java.net/~thartmann/8059735/webrev.00/">http://cr.openjdk.java.net/~thartmann/8059735/webrev.00/</a>
          <br>
          <br>
          Problem:
          <br>
          In 'NMethodSweeper::process_nmethod' a non-entrant nmethod is
          <br>
          processed and can be converted to zombie (line 549 of
          sweeper.cpp). To
          <br>
          clean the IC stubs of that nmethod [1] we acquire the
          CompiledIC_lock
          <br>
          and check for a safepoint. In this case, there is a safepoint
          request
          <br>
          and we block. During the safepoint a VM_Deoptimize operation
          is
          <br>
          executed (due to classloading) and the non-entrant nmethod is
          set to
          <br>
          zombie by 'CodeCache::make_marked_nmethods_zombies'. After the
          <br>
          safepoint the sweeper continues and tries to set the nmethod
          to zombie
          <br>
          again.
          <br>
          <br>
          Solution:
          <br>
          Use a MutexLockerEx with the '_no_safepoint_check_flag' to
          acquire the
          <br>
          CompiledIC_lock.
          <br>
          <br>
          Testing:
          <br>
          - Failing tests
          <br>
          - JPRT
          <br>
          <br>
          Thanks,
          <br>
          Tobias
          <br>
          <br>
          [1] <a class="moz-txt-link-freetext" href="https://bugs.openjdk.java.net/browse/JDK-8058737">https://bugs.openjdk.java.net/browse/JDK-8058737</a>
          <br>
        </blockquote>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>