Hello,

This generally looks fine to me. Some nits below.

On Tue, Oct 06, 2020 at 03:06:07PM +0300, Tariq Toukan wrote:
> @@ -432,6 +433,9 @@ struct workqueue_struct *alloc_workqueue(const char *fmt,
>                       WQ_MEM_RECLAIM, 1, (name))
>  #define create_singlethread_workqueue(name)                          \
>       alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name)
> +#define create_singlethread_sysfs_workqueue(name)                    \
> +     alloc_ordered_workqueue("%s", __WQ_MAX_ACTIVE_RO |              \
> +                             __WQ_LEGACY | WQ_MEM_RECLAIM, name)

Please don't add a new wrapper. Just convert the user to call
alloc_ordered_workqueue() directly. I don't think we need __WQ_MAX_ACTIVE_RO
as a separate flag. The behavior can be implied in __WQ_ORDERED_EXPLICIT,
and __WQ_LEGACY is there just to disable dependency check because users of
older interace aren't marking MEM_RECLAIM correctly.

> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index c41c3c17b86a..a80d34726e68 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -4258,6 +4258,9 @@ struct workqueue_struct *alloc_workqueue(const char 
> *fmt,
>       if ((flags & WQ_POWER_EFFICIENT) && wq_power_efficient)
>               flags |= WQ_UNBOUND;
>  
> +     if (flags & __WQ_MAX_ACTIVE_RO)
> +             flags |= WQ_SYSFS;

Just let the user set WQ_SYSFS like other users?

Thanks.

-- 
tejun

Reply via email to