lkml.org 
[lkml]   [2020]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] workqueue: Add support for exposing singlethread workqueues in sysfs
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

\
 
 \ /
  Last update: 2020-11-25 14:15    [W:0.086 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site