Module Name: src
Committed By: riastradh
Date: Thu Feb 23 03:01:35 UTC 2023
Modified Files:
src/sys/kern: subr_pcq.c
Log Message:
pcq(9): Explain why store need not be atomic in pcq_get.
No functional change intended.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_pcq.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_pcq.c
diff -u src/sys/kern/subr_pcq.c:1.15 src/sys/kern/subr_pcq.c:1.16
--- src/sys/kern/subr_pcq.c:1.15 Thu Feb 23 03:01:22 2023
+++ src/sys/kern/subr_pcq.c Thu Feb 23 03:01:35 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pcq.c,v 1.15 2023/02/23 03:01:22 riastradh Exp $ */
+/* $NetBSD: subr_pcq.c,v 1.16 2023/02/23 03:01:35 riastradh Exp $ */
/*-
* Copyright (c) 2009, 2019 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.15 2023/02/23 03:01:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.16 2023/02/23 03:01:35 riastradh Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -168,6 +168,10 @@ pcq_get(pcq_t *pcq)
*/
return NULL;
}
+ /*
+ * We have exclusive access to this slot, so no need for
+ * atomic_store_*.
+ */
pcq->pcq_items[c] = NULL;
c = pcq_advance(pcq, c);
nv = pcq_combine(p, c);