Re: [PATCH 1/2] workqueue: Allow to expose ordered workqueues via sysfs

From: Tejun Heo

Date: Thu Feb 05 2026 - 16:59:29 EST


On Thu, Feb 05, 2026 at 02:39:13PM +0100, Sebastian Andrzej Siewior wrote:
> +static umode_t wq_sysfs_is_visible(struct kobject *kobj, struct attribute *a, int n)
> +{
> + struct device *dev = kobj_to_dev(kobj);
> + struct workqueue_struct *wq = dev_to_wq(dev);
> +
> + /*
> + * Adjusting max_active breaks ordering guarantee. Changing it has no
> + * effect on BH worker. Limit max_active to RO in such case.
> + */
> + if (wq->flags & (WQ_BH | __WQ_ORDERED))
> + return 0444;
> + return a->mode;
> +}
> +
> +static const struct attribute_group wq_sysfs_group = {
> + .is_visible = wq_sysfs_is_visible,
> + .attrs = wq_sysfs_attrs,
> +};
> +__ATTRIBUTE_GROUPS(wq_sysfs);

Yeah, this looks fine to me.

Thanks.

--
tejun