opnsense-src/sys/compat/linuxkpi/common/include
Vladimir Kondratyev 2c9bb9c618 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

(cherry picked from commit b6f87b78b5)
2022-06-02 00:50:14 +03:00
..
acpi LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards 2022-01-22 22:34:38 +03:00
asm linuxkpi: Add atomic64_fetch_add 2022-03-05 12:12:44 +01:00
linux LinuxKPI: Implement kthread_worker related functions 2022-06-02 00:50:14 +03:00
net linuxkpi: Add parentheses to pacify -Wparentheses warnings from GCC. 2022-05-10 17:06:44 -07:00
stdarg.h LinuxKPI: Add stdarg.h proxy header 2022-01-22 22:34:36 +03:00