From: Lai Jiangshan <laijs@linux.alibaba.com>
To: linux-kernel@vger.kernel.org
Cc: Lai Jiangshan <laijs@linux.alibaba.com>,
Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>
Subject: [PATCH 2/2] workqueue: remove useless POOL_MANAGER_ACTIVE
Date: Thu, 28 May 2020 03:06:56 +0000 [thread overview]
Message-ID: <20200528030657.1690-2-laijs@linux.alibaba.com> (raw)
In-Reply-To: <20200528030657.1690-1-laijs@linux.alibaba.com>
It is the same meaning as pool->manager now.
Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
---
kernel/workqueue.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index fde10a5dba82..8bc11075763b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -70,7 +70,6 @@ enum {
* wq_pool_attach_mutex to avoid changing binding state while
* worker_attach_to_pool() is in progress.
*/
- POOL_MANAGER_ACTIVE = 1 << 0, /* being managed */
POOL_DISASSOCIATED = 1 << 2, /* cpu can't serve workers */
/* worker flags */
@@ -798,7 +797,7 @@ static bool need_to_create_worker(struct worker_pool *pool)
/* Do we have too many workers and should some go away? */
static bool too_many_workers(struct worker_pool *pool)
{
- bool managing = pool->flags & POOL_MANAGER_ACTIVE;
+ bool managing = !!pool->manager;
int nr_idle = pool->nr_idle + managing; /* manager is considered idle */
int nr_busy = pool->nr_workers - nr_idle;
@@ -2132,7 +2131,7 @@ static bool manage_workers(struct worker *worker)
struct work_struct, entry);
struct pool_workqueue *pwq = get_work_pwq(work);
- if (pool->flags & POOL_MANAGER_ACTIVE)
+ if (pool->manager)
return false;
/*
@@ -2143,13 +2142,11 @@ static bool manage_workers(struct worker *worker)
*/
get_pwq(pwq);
- pool->flags |= POOL_MANAGER_ACTIVE;
pool->manager = worker;
maybe_create_worker(pool);
pool->manager = NULL;
- pool->flags &= ~POOL_MANAGER_ACTIVE;
put_pwq(pwq);
return true;
}
--
2.20.1
next prev parent reply other threads:[~2020-05-28 3:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 19:46 [PATCH v2 0/2] workqueue: Make the workqueue code PREEMPT_RT safe Sebastian Andrzej Siewior
2020-05-27 19:46 ` [PATCH v2 1/2] workqueue: Use rcuwait for wq_manager_wait Sebastian Andrzej Siewior
2020-05-28 3:06 ` [PATCH 1/2] workqueue: pin the pool while it is managing Lai Jiangshan
2020-05-28 3:06 ` Lai Jiangshan [this message]
2020-05-28 8:08 ` Sebastian Andrzej Siewior
2020-05-28 8:35 ` Lai Jiangshan
2020-05-28 14:35 ` Tejun Heo
2020-05-29 5:33 ` Lai Jiangshan
2020-05-27 19:46 ` [PATCH v2 2/2] workqueue: Convert the pool::lock and wq_mayday_lock to raw_spinlock_t Sebastian Andrzej Siewior
2020-05-28 0:33 ` Lai Jiangshan
2020-05-29 14:04 ` Tejun Heo
2020-05-27 22:57 ` [PATCH v2 0/2] workqueue: Make the workqueue code PREEMPT_RT safe Linus Torvalds
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=20200528030657.1690-2-laijs@linux.alibaba.com \
--to=laijs@linux.alibaba.com \
--cc=jiangshanlai@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome