From: Tejun Heo <tj@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>,
linux-kernel@vger.kernel.org, Saeed Mahameed <saeedm@nvidia.com>,
Eran Ben Elisha <eranbe@nvidia.com>,
Moshe Shemesh <moshe@nvidia.com>,
netdev@vger.kernel.org
Subject: Re: [RFC PATCH] workqueue: Add support for exposing singlethread workqueues in sysfs
Date: Wed, 25 Nov 2020 08:14:02 -0500 [thread overview]
Message-ID: <X75Ymvo1AhSLAKNP@mtj.duckdns.org> (raw)
In-Reply-To: <20201006120607.20310-1-tariqt@nvidia.com>
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
prev parent reply other threads:[~2020-11-25 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-06 12:06 Tariq Toukan
2020-11-25 13:14 ` Tejun Heo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=X75Ymvo1AhSLAKNP@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=eranbe@nvidia.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®