Add a second membar producer into counters_zero(). Now it is
authorbluhm <bluhm@openbsd.org>
Mon, 3 Oct 2022 14:10:53 +0000 (14:10 +0000)
committerbluhm <bluhm@openbsd.org>
Mon, 3 Oct 2022 14:10:53 +0000 (14:10 +0000)
symmetric to counters_read().
OK jmatthew@

sys/kern/subr_percpu.c

index ef46eae..4cc66d0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: subr_percpu.c,v 1.9 2021/03/10 10:21:47 jsg Exp $ */
+/*     $OpenBSD: subr_percpu.c,v 1.10 2022/10/03 14:10:53 bluhm Exp $ */
 
 /*
  * Copyright (c) 2016 David Gwynne <dlg@openbsd.org>
@@ -213,6 +213,7 @@ counters_zero(struct cpumem *cm, unsigned int n)
        unsigned int i;
 
        counters = cpumem_first(&cmi, cm);
+       membar_producer();
        do {
                for (i = 0; i < n; i++)
                        counters[i] = 0;