git: 622bf596b718 - main - man: Add new smp_rendezvous.9

From: Benedict Reuschling <bcr_at_FreeBSD.org>
Date: Fri, 30 Oct 2026 16:33:15 UTC
The branch main has been updated by bcr:

URL: https://cgit.FreeBSD.org/src/commit/?id=622bf596b71826d2e10788c81be624cec4d641fb

commit 622bf596b71826d2e10788c81be624cec4d641fb
Author:     Federico Angelilli <code@fedang.net>
AuthorDate: 2026-10-30 16:28:30 +0000
Commit:     Benedict Reuschling <bcr@FreeBSD.org>
CommitDate: 2026-10-30 16:32:01 +0000

    man: Add new smp_rendezvous.9
    
    Event:                  Oslo Hackaton 2026
    Differential Revision:  https://reviews.freebsd.org/D61040
---
 share/man/man9/Makefile         |   1 +
 share/man/man9/smp_rendezvous.9 | 112 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 414ff7c998e0..fb46f9cee884 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -335,6 +335,7 @@ MAN=	accept_filter.9 \
 	signal.9 \
 	sleep.9 \
 	sleepqueue.9 \
+	smp_rendezvous.9 \
 	smr.9 \
 	socket.9 \
 	stack.9 \
diff --git a/share/man/man9/smp_rendezvous.9 b/share/man/man9/smp_rendezvous.9
new file mode 100644
index 000000000000..81335872fa42
--- /dev/null
+++ b/share/man/man9/smp_rendezvous.9
@@ -0,0 +1,112 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.\" Copyright (c) 2026 Federico Angelilli <fedang@FreeBSD.org>
+.\"
+.Dd October 28, 2026
+.Dt SMP_RENDEZVOUS 9
+.Os
+.Sh NAME
+.Nm smp_rendezvous ,
+.Nm smp_rendezvous_cpu ,
+.Nm smp_rendezvous_cpus ,
+.Nm smp_rendezvous_cpus_retry ,
+.Nm smp_rendezvous_cpus_done ,
+.Nm smp_no_rendezvous_barrier
+.Nd temporarily halt multiprocessing to run designated routine
+.Sh SYNOPSIS
+.In sys/smp.h
+.Ft void
+.Fo smp_rendezvous
+.Fa "void (* setup_func)(void *)"
+.Fa "void (* action_func)(void *)"
+.Fa "void (* teardown_func)(void *)"
+.Fa "void *arg"
+.Fc
+.Ft void
+.Fo smp_rendezvous_cpu
+.Fa "u_int cpuid"
+.Fa "void (*setup_func)(void *)"
+.Fa "void (*action_func)(void *)"
+.Fa "void (*teardown_func)(void *)"
+.Fa "void *arg"
+.Fc
+.Ft void
+.Fo smp_rendezvous_cpus
+.Fa "cpuset_t map"
+.Fa "void (*setup_func)(void *)"
+.Fa "void (*action_func)(void *)"
+.Fa "void (*teardown_func)(void *)"
+.Fa "void *arg"
+.Fc
+.Ft void
+.Fo smp_rendezvous_cpus_retry
+.Fa "cpuset_t map"
+.Fa "void (* setup_func)(void *)"
+.Fa "void (* action_func)(void *)"
+.Fa "void (* teardown_func)(void *)"
+.Fa "void (* wait_func)(void *, int)"
+.Fa "struct smp_rendezvous_cpus_retry_arg *arg"
+.Fc
+.Ft void
+.Fo smp_rendezvous_cpus_done
+.Fa "struct smp_rendezvous_cpus_retry_arg *arg"
+.Fc
+.Sh DESCRIPTION
+These functions provide an interface for interrupting the normal SMP
+flow on a set of CPUs to execute an
+.Fa action
+routine on all of them.
+The
+.Fa setup
+and
+.Fa teardown
+functions are executed before and after the action, respectively.
+Between the setup and action, all CPUs are synchronized with a barrier, unless
+.Nm smp_rendezvous_no_barrier
+is specified as the setup argument.
+The same mechanism applies to the transition between action and teardown.
+.Pp
+The
+.Fn smp_rendezvous_cpus
+function starts a rendezvous with the CPUs specified in the given
+.Fa map .
+The
+.Fa arg
+parameter is directly passed to the callbacks.
+.Pp
+The
+.Fn smp_rendezvous
+and
+.Fn smp_rendezvous_cpu
+functions act the same, respectively targeting all the CPUs or the one matching
+.Fa cpuid .
+.Pp
+The
+.Fn smp_rendezvous_cpus_retry
+function repeatedly starts a rendezvous until all of the CPUs in the given
+.Fa map
+acknowledged completion by calling
+.Fn smp_rendezvous_cpus_done .
+In this case, the
+.Fa arg
+parameter is used to keep track of the working set of CPUs.
+.Bd -literal -offset indent
+struct smp_rendezvous_cpus_retry_arg {
+	cpuset_t cpus;
+};
+.Ed
+.Pp
+The
+.Fn smp_rendezvous_no_barrier
+function is just a sentinel and should not be called.
+.Sh SEE ALSO
+.Xr cpuset 9
+.Sh HISTORY
+The
+.Nm smp_rendezvous
+function was first introduced in
+.Fx 3.3 .
+.Sh AUTHORS
+This manual page was written by
+.An Federico Angelilli Aq Mt fedang@FreeBSD.org .