diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index ffdeec292daa..da86b0e4c157 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -1327,14 +1327,13 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (atomic_load_acq_int(&ithd->it_need) != 0) { + while (atomic_swap_int(&ithd->it_need, 0) != 0) { /* - * This might need a full read and write barrier - * to make sure that this write posts before any - * of the memory or device accesses in the - * handlers. + * This needs a release barrier to make sure + * that this write posts before any of the + * memory or device accesses in the handlers. */ - atomic_store_rel_int(&ithd->it_need, 0); + atomic_thread_fence_acq_rel(); ithread_execute_handlers(p, ie); } WITNESS_WARN(WARN_PANIC, NULL, "suspending ithread"); @@ -1507,14 +1506,13 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (atomic_load_acq_int(&ithd->it_need) != 0) { + while (atomic_swap_int(&ithd->it_need, 0) != 0) { /* - * This might need a full read and write barrier - * to make sure that this write posts before any - * of the memory or device accesses in the - * handlers. + * This needs a release barrier to make sure + * that this write posts before any of the + * memory or device accesses in the handlers. */ - atomic_store_rel_int(&ithd->it_need, 0); + atomic_thread_fence_acq_rel(); if (priv) priv_ithread_execute_handler(p, ih); else