<div dir="ltr"><div>Hi Bart-</div><div><br></div><div>are the semantics below really safe, the don't appear to? Any caller of checker_thread_running is relaying on stale information. The c->thread_running could have changed as soon as you unlock. </div><div><br></div><div>+static unsigned checker_thread_running(struct tur_checker_context *ct)</div><div>+{</div><div>+<span class="" style="white-space:pre">    </span>unsigned thread_running;</div><div>+</div><div>+<span class="" style="white-space:pre">  </span>pthread_spin_lock(&ct->hldr_lock);</div><div>+<span class="" style="white-space:pre"> </span>thread_running = ct->thread_running;</div><div>+<span class="" style="white-space:pre">   </span>pthread_spin_unlock(&ct->hldr_lock);</div><div>+</div><div>+<span class="" style="white-space:pre">       </span>return thread_running;</div><div>+}</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 16, 2016 at 3:11 PM, Bart Van Assche <span dir="ltr"><<a href="mailto:bart.vanassche@sandisk.com" target="_blank">bart.vanassche@sandisk.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 08/15/2016 11:31 PM, Hannes Reinecke wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Makes one wonder: what happens to the waitevent threads?<br>
We won't be waiting for them after applying this patch, right?<br>
So why did we ever had this busy loop here?<br>
Ben?<br>
<br>
(And while we're at the subject: can't we drop the waitevent threads<br>
altogether? We're listening to uevents nowadays, so we should be<br>
notified if something happened to the device-mapper tables. Which should<br>
make the waitevent threads unnecessary, right?)<br>
</blockquote>
<br></span>
Hello Hannes,<br>
<br>
Maybe this is not what you had in mind, but would you agree with the attached two patches?<br>
<br>
Thanks,<br>
<br>
Bart.<br>
<br>
<br>
<br>--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/dm-devel</a><br></blockquote></div><br></div>