]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: tasks: Use __ha_barrier_store after modifying global_tasks_mask.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 18 Apr 2019 12:12:51 +0000 (14:12 +0200)
committerOlivier Houchard <cognet@ci0.org>
Thu, 18 Apr 2019 12:14:10 +0000 (14:14 +0200)
Now that we no longer use atomic operations to update global_tasks_mask,
as it's always modified while holding the TASK_RQ_LOCK, we have to use
__ha_barrier_store() instead of __ha_barrier_atomic_store() to ensure
any modification of global_tasks_mask is seen before modifying
active_tasks_mask.

This should be backported to 1.9.

src/task.c

index b4f65e892a466a655e5c57a6dd6fff39278f1949..de6eda1e727b8f6b76e9f55cc10b1f8989f5dee9 100644 (file)
@@ -78,7 +78,7 @@ void __task_wakeup(struct task *t, struct eb_root *root)
 #ifdef USE_THREAD
        if (root == &rqueue) {
                global_tasks_mask |= t->thread_mask;
-               __ha_barrier_atomic_store();
+               __ha_barrier_store();
        }
 #endif
        _HA_ATOMIC_OR(&active_tasks_mask, t->thread_mask);