mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-01 23:04:54 +01:00
perf test workload thloop: Make count increments atomic
The count variable is incremented by multiple threads, doing so without an atomic operation causes thread sanitizer warnings. Switch to using relaxed atomics. Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
316769f757
commit
1962ab6f6e
1 file changed
+1
-1
@@ -20,7 +20,7 @@ static void sighandler(int sig __maybe_unused)
|
||||
noinline void test_loop(void)
|
||||
{
|
||||
while (!done)
|
||||
count++;
|
||||
__atomic_fetch_add(&count, 1, __ATOMIC_RELAXED);
|
||||
}
|
||||
|
||||
static void *thfunc(void *arg)
|
||||
|
||||
Reference in new issue
Block a user