diff options
author | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-10-12 15:32:39 +0000 |
---|---|---|
committer | Scott Soule Cheloha <cheloha@cvs.openbsd.org> | 2023-10-12 15:32:39 +0000 |
commit | fb0c008b2c2984237d0ea8799959b1c1dcd3bbf0 (patch) | |
tree | 6f58f594e8088ff7c76cbf0aea9fabdbdf828174 /share/man/man9 | |
parent | f50bfdb6ce3bae6323107fc1f01b99bb2247f430 (diff) |
timeout: add TIMEOUT_MPSAFE flag
Add a TIMEOUT_MPSAFE flag to signal that a timeout is safe to run
without the kernel lock. Currently, TIMEOUT_MPSAFE requires
TIMEOUT_PROC. When the softclock() is unlocked in the future this
dependency will be removed.
On MULTIPROCESSOR kernels, softclock() now shunts TIMEOUT_MPSAFE
timeouts to a dedicated "timeout_proc_mp" bucket for processing by the
dedicated softclock_thread_mp() kthread. Unlike softclock_thread(),
softclock_thread_mp() is not pinned to any CPU and runs run at IPL_NONE.
Prompted by bluhm@. Lots of input from bluhm@. Joint work with mvs@.
Prompt: https://marc.info/?l=openbsd-tech&m=169646019109736&w=2
Thread: https://marc.info/?l=openbsd-tech&m=169652212131109&w=2
ok mvs@
Diffstat (limited to 'share/man/man9')
-rw-r--r-- | share/man/man9/timeout.9 | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/share/man/man9/timeout.9 b/share/man/man9/timeout.9 index cbc6eb3ed34..4b37ebea1f4 100644 --- a/share/man/man9/timeout.9 +++ b/share/man/man9/timeout.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: timeout.9,v 1.56 2023/01/01 01:19:18 cheloha Exp $ +.\" $OpenBSD: timeout.9,v 1.57 2023/10/12 15:32:38 cheloha Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org> .\" Copyright (c) 2021, 2022 Scott Cheloha <cheloha@openbsd.org> @@ -24,7 +24,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 1 2023 $ +.Dd $Mdocdate: October 12 2023 $ .Dt TIMEOUT_SET 9 .Os .Sh NAME @@ -193,11 +193,16 @@ Counts the time elapsed since the system booted. The timeout's behavior may be configured with the bitwise OR of zero or more of the following .Fa flags : -.Bl -tag -width TIMEOUT_PROC +.Bl -tag -width TIMEOUT_MPSAFE .It Dv TIMEOUT_PROC Execute the timeout in a process context instead of the default .Dv IPL_SOFTCLOCK interrupt context. +.It Dv TIMEOUT_MPSAFE +Execute the timeout without the kernel lock. +Requires the +.Dv TIMEOUT_PROC +flag. .El .El .Pp @@ -367,8 +372,9 @@ The function .Fa fn must not block and must be safe to execute on any CPU in the system. .Pp -Currently, -all timeouts are executed under the kernel lock. +Timeouts without the +.Dv TIMEOUT_MPSAFE +flag are executed under the kernel lock. .Sh RETURN VALUES .Fn timeout_add , .Fn timeout_add_sec , |