aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/taskqueue.9
diff options
context:
space:
mode:
authorVladimir Kondratyev <wulf@FreeBSD.org>2022-05-17 12:10:20 +0000
committerVladimir Kondratyev <wulf@FreeBSD.org>2022-05-17 12:10:20 +0000
commitb6f87b78b5bb48e00f54b96ddea7ad5bf5e3aa1f (patch)
tree6cf336cd13740e3dc9c60abc3f993056a9ef5563 /share/man/man9/taskqueue.9
parent0093bc3cd17c2f657682258fae73737655b8a573 (diff)
downloadsrc-b6f87b78b5bb48e00f54b96ddea7ad5bf5e3aa1f.tar.gz
src-b6f87b78b5bb48e00f54b96ddea7ad5bf5e3aa1f.zip
LinuxKPI: Implement kthread_worker related functions
Kthread worker is a single thread workqueue which can be used in cases where specific kthread association is necessary, for example, when it should have RT priority or be assigned to certain cgroup. This change implements Linux v4.9 interface which mostly hides kthread internals from users thus allowing to use ordinary taskqueue(9) KPI. As kthread worker prohibits enqueueing of already pending or canceling tasks some minimal changes to taskqueue(9) were done. taskqueue_enqueue_flags() was added to taskqueue KPI which accepts extra flags parameter. It contains one or more of the following flags: TASKQUEUE_FAIL_IF_PENDING - taskqueue_enqueue_flags() fails if the task is already scheduled to execution. EEXIST is returned and the ta_pending counter value remains unchanged. TASKQUEUE_FAIL_IF_CANCELING - taskqueue_enqueue_flags() fails if the task is in the canceling state and ECANCELED is returned. Required by: drm-kmod 5.10 MFC after: 1 week Reviewed by: hselasky, Pau Amma (docs) Differential Revision: https://reviews.freebsd.org/D35051
Diffstat (limited to 'share/man/man9/taskqueue.9')
-rw-r--r--share/man/man9/taskqueue.926
1 files changed, 25 insertions, 1 deletions
diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9
index 58eb6b7c5571..e13ad9498562 100644
--- a/share/man/man9/taskqueue.9
+++ b/share/man/man9/taskqueue.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 1, 2021
+.Dd April 25, 2022
.Dt TASKQUEUE 9
.Os
.Sh NAME
@@ -85,6 +85,8 @@ struct timeout_task;
.Ft int
.Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task"
.Ft int
+.Fn taskqueue_enqueue_flags "struct taskqueue *queue" "struct task *task" "int flags"
+.Ft int
.Fn taskqueue_enqueue_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" "int ticks"
.Ft int
.Fn taskqueue_enqueue_timeout_sbt "struct taskqueue *queue" "struct timeout_task *timeout_task" "sbintime_t sbt" "sbintime_t pr" "int flags"
@@ -225,6 +227,28 @@ is called on the task pointer passed to
.Fn taskqueue_enqueue .
.Pp
The
+.Fn taskqueue_enqueue_flags
+accepts an extra
+.Va flags
+parameter which specifies a set of optional flags to alter the behavior of
+.Fn taskqueue_enqueue .
+It contains one or more of the following flags:
+.Bl -tag -width TASKQUEUE_FAIL_IF_CANCELING
+.It Dv TASKQUEUE_FAIL_IF_PENDING
+.Fn taskqueue_enqueue_flags
+fails if the task is already scheduled for execution.
+.Er EEXIST
+is returned and the
+.Va ta_pending
+counter value remains unchanged.
+.It Dv TASKQUEUE_FAIL_IF_CANCELING
+.Fn taskqueue_enqueue_flags
+fails if the task is in the canceling state and
+.Er ECANCELED
+is returned.
+.El
+.Pp
+The
.Fn taskqueue_enqueue_timeout
function is used to schedule the enqueue after the specified number of
.Va ticks .