<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WORKSFORME - [CI] igt@sw_sync@sync_multi_consumer_producer - fail - Failed assertion: counter == MULTI_CONSUMER_PRODUCER_THREADS * MULTI_CONSUMER_PRODUCER_ITERATIONS"
href="https://bugs.freedesktop.org/show_bug.cgi?id=106344#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WORKSFORME - [CI] igt@sw_sync@sync_multi_consumer_producer - fail - Failed assertion: counter == MULTI_CONSUMER_PRODUCER_THREADS * MULTI_CONSUMER_PRODUCER_ITERATIONS"
href="https://bugs.freedesktop.org/show_bug.cgi?id=106344">bug 106344</a>
from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
<pre>Applied
commit 91f5d4665b07f073c78abd3cd4b8e0e347dbf638 (upstream/master)
Author: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
Date: Wed May 2 10:24:26 2018 +0100
igt/sw_sync: Wrap threaded counter manipulation with mb
sw_sync/sync_multi_consumer_producer was communicating between threads
using the sw_sync ioctl and manipulating a shared volatile counter.
However, the ioctl itself does not imply a memory barrier, and so
different CPUs may see different states of the counter (the volatile
making GCC perform the operation in stages making the race even more
likely). Instead of using volatile, use locked operations to make the
counter manipulation thread-safe.
References: <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WORKSFORME - [CI] igt@sw_sync@sync_multi_consumer_producer - fail - Failed assertion: counter == MULTI_CONSUMER_PRODUCER_THREADS * MULTI_CONSUMER_PRODUCER_ITERATIONS"
href="show_bug.cgi?id=106344">https://bugs.freedesktop.org/show_bug.cgi?id=106344</a>
Signed-off-by: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
Reviewed-by: Joonas Lahtinen <<a href="mailto:joonas.lahtinen@linux.intel.com">joonas.lahtinen@linux.intel.com</a>>
for good measure.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are on the CC list for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>