aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-01-21 13:53:34 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-07-13 14:58:23 +0000
commit058ce52660fb52ada41462d339fb1ce6aca48cf3 (patch)
tree4486ae9465d1fcb14eff27f4691efd2d4797b208
parent97de8330e1683e41883887d19ea489bda90e5c61 (diff)
LinuxKPI: add system_percpu_wq
In Linux v6.17 system_wq was replaced (renamed to) system_percpu_wq, with the old name still present. We just alias system_percpu_wq to linux_system_short_wq like we do for system_wq to keep both around for the forseeable future. Note: the original system_wq was a per-cpu queue upstream as well based on my understanding but we never implemented it as such. That means we are still lacking a per-cpu implementation for system_percpu_wq but at least we do not change the status-quo of the LinuxKPI implementation with this. Note2: we should add a check somewhere for LINUXKPI_VESION >= 61700 to print a warning if anyone still uses the system_wq to detect any possible sami-native or out-of-tree drivers relying on this and not properly updating. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell; emaste (comments on previous review) Differential Revision: https://reviews.freebsd.org/D57730
-rw-r--r--sys/compat/linuxkpi/common/include/linux/workqueue.h1
-rw-r--r--sys/compat/linuxkpi/common/src/linux_work.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/workqueue.h b/sys/compat/linuxkpi/common/include/linux/workqueue.h
index 66d3981d4229..b531d4f34658 100644
--- a/sys/compat/linuxkpi/common/include/linux/workqueue.h
+++ b/sys/compat/linuxkpi/common/include/linux/workqueue.h
@@ -237,6 +237,7 @@ extern struct workqueue_struct *system_long_wq;
extern struct workqueue_struct *system_unbound_wq;
extern struct workqueue_struct *system_highpri_wq;
extern struct workqueue_struct *system_power_efficient_wq;
+extern struct workqueue_struct *system_percpu_wq;
extern void linux_init_delayed_work(struct delayed_work *, work_func_t);
extern void linux_work_fn(void *, int);
diff --git a/sys/compat/linuxkpi/common/src/linux_work.c b/sys/compat/linuxkpi/common/src/linux_work.c
index b1975d16025e..bb25893d9c71 100644
--- a/sys/compat/linuxkpi/common/src/linux_work.c
+++ b/sys/compat/linuxkpi/common/src/linux_work.c
@@ -57,6 +57,7 @@ struct workqueue_struct *system_long_wq;
struct workqueue_struct *system_unbound_wq;
struct workqueue_struct *system_highpri_wq;
struct workqueue_struct *system_power_efficient_wq;
+struct workqueue_struct *system_percpu_wq;
struct taskqueue *linux_irq_work_tq;
@@ -721,7 +722,14 @@ linux_work_init(void *arg)
/* populate the workqueue pointers */
system_long_wq = linux_system_long_wq;
+ /*
+ * With Linux v6.17 system_wq was "renamed" to system_percpu_wq with the
+ * old name staying around.
+ * Note: neither implementation here does fully implement the per-cpu
+ * characteristics upstream expects.
+ */
system_wq = linux_system_short_wq;
+ system_percpu_wq = linux_system_short_wq;
system_power_efficient_wq = linux_system_short_wq;
system_unbound_wq = linux_system_short_wq;
system_highpri_wq = linux_system_short_wq;
@@ -737,6 +745,7 @@ linux_work_uninit(void *arg)
/* clear workqueue pointers */
system_long_wq = NULL;
system_wq = NULL;
+ system_percpu_wq = NULL;
system_power_efficient_wq = NULL;
system_unbound_wq = NULL;
system_highpri_wq = NULL;