History log of /freebsd/sys/compat/linuxkpi/common/include/linux/workqueue.h (Results 1 – 25 of 29)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# eed3be47 12-May-2025 Mark Johnston <markj@FreeBSD.org>

linuxkpi: Fix up jiffies handling

A few issues found by code inspection while hunting for bugzilla PR
286512:
- The "expires" field in struct delayed_work should be unsigned.
- In linux_timer_jiffie

linuxkpi: Fix up jiffies handling

A few issues found by code inspection while hunting for bugzilla PR
286512:
- The "expires" field in struct delayed_work should be unsigned.
- In linux_timer_jiffies_until(), clamp the return value to INT_MAX:
this return value is used as a ticks count, not a jiffies count, so we
should avoid returning too large a value, lest it get truncated. It's
unlikely we are dealing with values that large, but we should be
careful anyway.
- In linux_add_to_sleepqueue(), truncate the timeout to INT_MAX, as this
value is passed to sleepq_set_timeout() as a ticks value. Typically
it's multiplied by ticks_sbt to get an sbintime, and we should make
sure the multiplication doesn't overflow. In drm-kmod, there is at
least one call mod_delayed_work(... MAX_SCHEDULE_TIMEOUT).

Fixes: 325aa4dbd10d ("linuxkpi: Introduce a properly typed jiffies")
Reviewed by: olce, bz, dumbbell, kib
Tested by: dumbbell, bz
Differential Revision: https://reviews.freebsd.org/D50192

show more ...


Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3
# 325aa4db 12-Jan-2025 Mark Johnston <markj@FreeBSD.org>

linuxkpi: Introduce a properly typed jiffies

Now that we have a long-sized tick counter, we can migrate to using
properly typed timeout parameters in various bits of the LinuxKPI. This
fixes a subt

linuxkpi: Introduce a properly typed jiffies

Now that we have a long-sized tick counter, we can migrate to using
properly typed timeout parameters in various bits of the LinuxKPI. This
fixes a subtle incompatibility that is otherwise difficult to paper over
and leads to bugs when ticks values are sign-extended.

- Introduce a "jiffies" symbol in subr_ticks.S, declared only in the
LinuxKPI as an unsigned long.
- Remove all references to "ticks" from the LinuxKPI.
- Convert interfaces to match Linux's type signatures where it makes
sense.

Reviewed by: manu
Tested by: bz
Differential Revision: https://reviews.freebsd.org/D48523

show more ...


# e5d57a88 25-Feb-2025 Jean-Sébastien Pédron <dumbbell@FreeBSD.org>

linuxkpi: Add `queue_work_node()`

This a variant of `queue_work()` that takes a NUMA node as its first
argument.

The NUMA node is ignored and `queue_work()` is called.

The i915 DRM driver started

linuxkpi: Add `queue_work_node()`

This a variant of `queue_work()` that takes a NUMA node as its first
argument.

The NUMA node is ignored and `queue_work()` is called.

The i915 DRM driver started to use this starting from Linux 6.8.

Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49377

show more ...


Revision tags: release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# 1b2f43a7 24-Dec-2023 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Add cancel_work() function.

Cancel a work not waiting for it to finish.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, kib
MFC after: 1 week
Differential Revision: https://

LinuxKPI: Add cancel_work() function.

Cancel a work not waiting for it to finish.

Sponsored by: Serenity Cyber Security, LLC
Reviewed by: manu, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D42811

show more ...


Revision tags: release/14.0.0
# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 307f78f3 19-Dec-2021 Vladimir Kondratyev <wulf@FreeBSD.org>

LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards

MFC after: 1 week
Reviewed by: bz, emaste, hselasky, manu
Differential Revision: https://reviews.freebsd.org/D33562


Revision tags: release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0
# 2491b25c 21-May-2020 Emmanuel Vadot <manu@FreeBSD.org>

linuxkpi: Add rcu_work functions

The rcu_work function helps to queue some work after waiting for a grace
period.
This is needed by DRM drivers.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hs

linuxkpi: Add rcu_work functions

The rcu_work function helps to queue some work after waiting for a grace
period.
This is needed by DRM drivers.

Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24942

show more ...


Revision tags: release/12.1.0
# 419fe172 17-Aug-2019 Conrad Meyer <cem@FreeBSD.org>

Linuxkpi: Prevent easy generated ctor name conflicts with prefix

Sponsored by: Dell EMC Isilon


Revision tags: release/11.3.0, release/12.0.0
# 14b841d4 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

MFH @ r337607, in preparation for boarding


# f9c0a512 10-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337286 through r337585.


# 549dcdb3 06-Aug-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement current_work() function in the LinuxKPI.

Tested by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies


Revision tags: release/11.2.0
# 7a13eeba 05-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Declare and set the global "system_highpri_wq" workqueue structure pointer
in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

Declare and set the global "system_highpri_wq" workqueue structure pointer
in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# c6d92030 05-Jun-2018 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement the INIT_DELAYED_WORK_ONSTACK() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Lim

Implement the INIT_DELAYED_WORK_ONSTACK() function macro in the LinuxKPI.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies
Sponsored by: Limelight Networks

show more ...


# 83630517 23-Mar-2018 Ed Maste <emaste@FreeBSD.org>

linuxkpi whitespace cleanup

Reviewed by: hselasky, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14807


# c2c014f2 07-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r323559 through r325504.


# 50896984 10-Oct-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r324482


# 87a567f1 04-Oct-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Make sure the timer belonging to the delayed work in the LinuxKPI
gets drained before invoking the work function. Else the timer
mutex may still be in use which can lead to use-after-free situations,

Make sure the timer belonging to the delayed work in the LinuxKPI
gets drained before invoking the work function. Else the timer
mutex may still be in use which can lead to use-after-free situations,
because the work function might free the work structure before returning.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


Revision tags: release/10.4.0, release/11.1.0
# f7328664 09-Mar-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully
initialize the declared work structure and not only the function callback
pointer.

MFC after: 1 week
Sponsored by: Mellanox

Fix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully
initialize the declared work structure and not only the function callback
pointer.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


# ca2ad6bd 07-Mar-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

LinuxKPI workqueue cleanup.

This change makes the workqueue implementation behave more like in
Linux, both functionality wise and structure wise.

All workqueue code has been moved to linux_work.c

LinuxKPI workqueue cleanup.

This change makes the workqueue implementation behave more like in
Linux, both functionality wise and structure wise.

All workqueue code has been moved to linux_work.c

Add an atomic based statemachine to the work_struct to ensure proper
operation. Prior to this change struct_work was directly mapped to a
FreeBSD task. When a taskqueue has multiple threads the same task may
end up being executed on more than one worker thread simultaneously.
This might cause problems with code coming from Linux, which expects
serial behaviour, similar to Linux tasklets.

Move all global workqueue function names into the linux_xxx domain to
avoid symbol name clashes in the future.

Implement a few more workqueue related functions and macros.

Create two multithreaded taskqueues for the LinuxKPI during module
load, one for time-consuming callbacks and one for non-time consuming
callbacks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


Revision tags: release/11.0.1, release/11.0.0, release/10.3.0
# b626f5a7 04-Jan-2016 Glen Barber <gjb@FreeBSD.org>

MFH r289384-r293170

Sponsored by: The FreeBSD Foundation


# 9a7cd2e6 22-Dec-2015 Bjoern A. Zeeb <bz@FreeBSD.org>

MFH @r292599

This includes the pluggable TCP framework and other chnages to the
netstack to track for VNET stability.

Security: The FreeBSD Foundation


# c4e58b4e 21-Dec-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Implement drain_workqueue() function.

MFC after: 1 week
Sponsored by: Mellanox Technologies


# 9782763d 21-Dec-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

In the zero delay case in queue_delayed_work() use the return value
from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
also ensure the callout is stopped before proceeding.

MFC af

In the zero delay case in queue_delayed_work() use the return value
from taskqueue_enqueue() instead of reading "ta_pending" unlocked and
also ensure the callout is stopped before proceeding.

MFC after: 1 week
Sponsored by: Mellanox Technologies

show more ...


# 55d445d3 21-Dec-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Minor workqueue cleanup:
- Make some functions global instead of inline to ease debugging.
- Fix some minor style issues.

MFC after: 1 week
Sponsored by: Mellanox Technologies


# c99bbcab 02-Dec-2015 Navdeep Parhar <np@FreeBSD.org>

Catch up with head.


12