lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] workqueue: remove useless POOL_MANAGER_ACTIVE
Date
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
\
 
 \ /
  Last update: 2020-05-28 05:08    [W:0.131 / U:5.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site