From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: Tejun Heo <tj@kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] workqueue: add __WQ_FREEZING and remove POOL_FREEZING
Date: Thu, 17 Apr 2014 07:58:55 +0800 [thread overview]
Message-ID: <534F193F.2070600@cn.fujitsu.com> (raw)
In-Reply-To: <20140416195109.GD22569@htj.dyndns.org>
On 04/17/2014 03:51 AM, Tejun Heo wrote:
> Hello,
>
> On Tue, Mar 25, 2014 at 05:56:04PM +0800, Lai Jiangshan wrote:
>> freezing is nothing related to pools, but POOL_FREEZING adds a connection,
>> and causes freeze_workqueues_begin() and thaw_workqueues() complicated.
>>
>> Since freezing is workqueue instance attribute, so we introduce __WQ_FREEZING
>> to wq->flags instead and remove POOL_FREEZING.
>>
>> we set __WQ_FREEZING only when freezable(to simplify pwq_adjust_max_active()),
>> make freeze_workqueues_begin() and thaw_workqueues() fast skip non-freezable wq.
>
> Please wrap the description to 80 columns.
>
>> @@ -3730,18 +3726,13 @@ static void pwq_unbound_release_workfn(struct work_struct *work)
>> static void pwq_adjust_max_active(struct pool_workqueue *pwq)
>> {
>> struct workqueue_struct *wq = pwq->wq;
>> - bool freezable = wq->flags & WQ_FREEZABLE;
>>
>> - /* for @wq->saved_max_active */
>> + /* for @wq->saved_max_active and @wq->flags */
>> lockdep_assert_held(&wq->mutex);
>>
>> - /* fast exit for non-freezable wqs */
>> - if (!freezable && pwq->max_active == wq->saved_max_active)
>> - return;
>> -
>
> Why are we removing the above? Can't we still test __WQ_FREEZING as
> we're holding wq->mutex? I don't really mind removing the
> optimization but the patch description at least has to explain what's
> going on.
This part was in other old patch: https://lkml.org/lkml/2013/4/3/756
I admit the changelogs(old patch&this) are bad.
But I still consider it would be better if we split it to two patches:
(https://lkml.org/lkml/2013/4/3/748 & https://lkml.org/lkml/2013/4/3/756)
There are different aims in the patches.
Any thinks? And sorry for I didn't keep to push the patches at that time.
Thanks
Lai
>
> ...
>> list_for_each_entry(wq, &workqueues, list) {
>> + if (!(wq->flags & WQ_FREEZABLE))
>> + continue;
>
> Ah, okay, you're not calling the function at all if WQ_FREEZABLE is
> not set. I couldn't really understand what you were trying to say in
> the patch description. Can you please try to refine the description
> more? It's better to be verbose and clear than short and difficult to
> understand.
>
> Thanks.
>
next prev parent reply other threads:[~2014-04-16 23:55 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-04 2:05 [PATCH 1/7] workqueue: add __WQ_FREEZING and remove POOL_FREEZING Lai Jiangshan
2013-04-04 2:05 ` [PATCH 2/7] workqueue: set __WQ_FREEZING only when freezable Lai Jiangshan
2013-04-04 2:05 ` [PATCH 3/7] workqueue: rename rebind_workers() to associate_cpu_pool() Lai Jiangshan
2013-04-04 14:15 ` Tejun Heo
2013-04-04 2:05 ` [PATCH 4/7] workqueue: simplify workqueue_cpu_up_callback(CPU_ONLINE) Lai Jiangshan
2013-04-04 2:05 ` [PATCH 5/7] workqueue, use default pwq when fail to allocate node pwd Lai Jiangshan
2013-04-04 14:34 ` Tejun Heo
2013-04-04 2:05 ` [PATCH 6/7] workqueue: node-awared allocation for unbound pool Lai Jiangshan
2013-04-04 14:38 ` Tejun Heo
2013-04-04 2:05 ` [PATCH 7/7] workqueue: avoid false negative WARN_ON() Lai Jiangshan
2013-04-04 14:55 ` [PATCH] workqueue: avoid false negative WARN_ON() in destroy_workqueue() Tejun Heo
2013-04-05 7:39 ` Lai Jiangshan
2013-04-04 14:12 ` [PATCH 1/7] workqueue: add __WQ_FREEZING and remove POOL_FREEZING Tejun Heo
2013-04-20 16:12 ` Lai Jiangshan
2013-04-21 1:29 ` Tejun Heo
2014-03-25 9:56 ` [PATCH] " Lai Jiangshan
2014-03-27 12:08 ` Lai Jiangshan
2014-03-27 14:48 ` Tejun Heo
2014-04-16 19:51 ` Tejun Heo
2014-04-16 23:58 ` Lai Jiangshan [this message]
2014-04-17 15:29 ` Tejun Heo
2014-04-16 20:50 ` Tejun Heo
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=534F193F.2070600@cn.fujitsu.com \
--to=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.