[PATCH 3/4] workqueue: export attribute and sysfs setup helpers
From: Huiwen He
Date: Mon Nov 30 2026 - 22:28:38 EST
From: Huiwen He <hehuiwen@xxxxxxxxxx>
The workqueue attribute helpers are not available to modules.
Export the allocation, application and release helpers for GPL modules.
Also export workqueue_sysfs_register() so a module can apply attributes
before exposing its queue in sysfs.
Signed-off-by: Huiwen He <hehuiwen@xxxxxxxxxx>
---
kernel/workqueue.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index a2a441837a9d..f525618afdb5 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5012,6 +5012,7 @@ void free_workqueue_attrs(struct workqueue_attrs *attrs)
kfree(attrs);
}
}
+EXPORT_SYMBOL_GPL(free_workqueue_attrs);
/**
* alloc_workqueue_attrs - allocate a workqueue_attrs
@@ -5040,6 +5041,7 @@ struct workqueue_attrs *alloc_workqueue_attrs_noprof(void)
free_workqueue_attrs(attrs);
return NULL;
}
+EXPORT_SYMBOL_GPL(alloc_workqueue_attrs_noprof);
static void copy_workqueue_attrs(struct workqueue_attrs *to,
const struct workqueue_attrs *from)
@@ -5878,6 +5880,7 @@ int apply_workqueue_attrs(struct workqueue_struct *wq,
return ret;
}
+EXPORT_SYMBOL_GPL(apply_workqueue_attrs);
/**
* unbound_wq_update_pwq - update a pwq slot for CPU hot[un]plug
@@ -8001,6 +8004,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq)
kobject_uevent(&wq_dev->dev.kobj, KOBJ_ADD);
return 0;
}
+EXPORT_SYMBOL_GPL(workqueue_sysfs_register);
/**
* workqueue_sysfs_unregister - undo workqueue_sysfs_register()