Module Name: src
Committed By: riastradh
Date: Wed Aug 2 06:24:46 UTC 2023
Modified Files:
src/share/man/man9: percpu.9
Log Message:
percpu(9): percpu_create ctor may be called later, not synchronously.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/percpu.9
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man9/percpu.9
diff -u src/share/man/man9/percpu.9:1.15 src/share/man/man9/percpu.9:1.16
--- src/share/man/man9/percpu.9:1.15 Fri Feb 7 15:11:46 2020
+++ src/share/man/man9/percpu.9 Wed Aug 2 06:24:46 2023
@@ -1,4 +1,4 @@
-.\" $NetBSD: percpu.9,v 1.15 2020/02/07 15:11:46 wiz Exp $
+.\" $NetBSD: percpu.9,v 1.16 2023/08/02 06:24:46 riastradh Exp $
.\"
.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -94,15 +94,18 @@ returns a handle for the per-CPU storage
.It Fn percpu_create "size" "ctor" "dtor" "arg"
Like
.Fn percpu_alloc ,
-but before returning, for each CPU, call
-.Fn "(*ctor)" p arg ci
-in the current thread, where
+but before any access to the storage on any CPU, arrange to call
+.Fn "(*ctor)" p arg ci ,
+where
.Fa p
is the pointer to that CPU's storage and
.Fa ci
is the
.Vt "struct cpu_info *"
for that CPU.
+This may happen synchronously in
+.Fn percpu_create
+or when a CPU is attached later.
Further, arrange that
.Fn percpu_free
will do the same with