On 08/09/2013 04:40 AM, Paul E. McKenney wrote:
On Wed, Aug 07, 2013 at 06:25:01PM +0800, Lai Jiangshan wrote:
Background)
Although all articles declare that rcu read site is deadlock-immunity.
It is not true for rcu-preempt, it will be deadlock if rcu read site
overlaps with scheduler lock
:
On Wed, Aug 07, 2013 at 06:25:01PM +0800, Lai Jiangshan wrote:
Background)
Although all articles declare that rcu read site is deadlock-immunity.
It is not true for rcu-preempt, it will be deadlock if rcu read site
overlaps with scheduler lock.
ec433f0c, 10f39bb1 and 016a8d5b just partially solve
On 03/24/2014 01:25 PM, Eric Dumazet wrote:
On Mon, 2014-03-24 at 07:09 +0200, Michael S. Tsirkin wrote:
Seems an incredibly strict requirement for something that just
silences a warning.
What exactly should I test?
I intended to just verify this produces same code as before
when freezable(to simplify pwq_adjust_max_active()),
make freeze_workqueues_begin() and thaw_workqueues() fast skip non-freezable wq.
Changed from previous patches(requested by tj):
1) added the WARN_ON_ONCE() back
2) merged the two patches as one
Signed-off-by: Lai Jiangshan la
worker_idr is always accessed in manager lock context currently.
worker_idr is highly related to managers, it will be unlikely
accessed in pool-lock only in future.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 34 ++
1 files changed
please omit this patch and wait for my new patchset.
Thanks,
Lai
On 03/26/2014 10:41 PM, Lai Jiangshan wrote:
worker_idr is always accessed in manager lock context currently.
worker_idr is highly related to managers, it will be unlikely
accessed in pool-lock only in future.
Signed-off
On 03/25/2014 05:56 PM, 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 rescuer_thead will access to corrupted
data.
Using get_pwq() when send_mayday() will keep @pwq's lifetime
and avoid the race condition.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c |7 +++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/kernel/workqueue.c
From 11af0cd0306309f0deaf3326cc26d3e7e517e3d1 Mon Sep 17 00:00:00 2001
From: Lai Jiangshan la...@cn.fujitsu.com
Date: Fri, 28 Mar 2014 00:20:12 +0800
Subject: [PATCH] workqueue: fix possible race condition when rescuer VS
pwq-release
There is a race condition between rescuer_thread
On Mon, May 5, 2014 at 9:01 PM, Tejun Heo t...@kernel.org wrote:
On Sun, Apr 27, 2014 at 12:08:56PM +0800, Lai Jiangshan wrote:
worker_idr is highly bound to managers and is always/only accessed in manager
lock context. So we don't need pool-lock for it.
Signed-off-by: Lai Jiangshan la
On Mon, May 5, 2014 at 9:13 PM, Tejun Heo t...@kernel.org wrote:
Hello,
On Sun, Apr 27, 2014 at 12:08:57PM +0800, Lai Jiangshan wrote:
@@ -1692,9 +1691,8 @@ static struct worker *alloc_worker(void)
* create_worker - create a new workqueue worker
* @pool: pool the new worker will belong
On Mon, May 5, 2014 at 11:02 PM, Tejun Heo t...@kernel.org wrote:
On Sun, Apr 27, 2014 at 12:08:58PM +0800, Lai Jiangshan wrote:
/**
+ * worker_unbind_pool() - unbind the worker from the pool
+ * @worker: worker which is bound to its pool
+ *
+ * Undo the pool-binding which had been done
On Mon, May 5, 2014 at 10:59 PM, Tejun Heo t...@kernel.org wrote:
On Sun, Apr 27, 2014 at 12:09:01PM +0800, Lai Jiangshan wrote:
@@ -2224,6 +2220,9 @@ woke_up:
spin_unlock_irq(pool-lock);
WARN_ON_ONCE(!list_empty(worker-entry));
worker-task-flags
POOL_MANAGE_WORKERS and
maybe_destroy_worker() and simplify the manage_workers()
After POOL_MANAGE_WORKERS is removed, worker_thread() doesn't
need to test whether it needs to manage after processed works.
So we can remove this test branch.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
can't allocate id from worker_idr.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 38 --
kernel/workqueue_internal.h |1 +
2 files changed, 13 insertions(+), 26 deletions(-)
diff --git a/kernel/workqueue.c b/kernel
manager_mutex to bind_mutex without any
functionality changed.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 47 +--
kernel/workqueue_internal.h |2 +-
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git
The code of pool-binding is unfolded in create_worker().
Separating this code out will make the codes more clear.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 53 ---
1 files changed, 33 insertions(+), 20 deletions
with the pool
across any cpuhotplugs.
Using generic pool-bind/unbind routine will solve the above problems,
and result much more simple code.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 74 +--
1 files changed, 8
.
In put_unbound_pool(), we also narrow the protection of manager_mutex
due to destroy_worker() doesn't need manager_mutex.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 42 --
1 files changed, 8 insertions(+), 34 deletions(-)
diff --git a/kernel
worker_unbind_pool()
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 44
1 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 7690d0c..7ca564d 100644
--- a/kernel/workqueue.c
We don't need to travell workers via worker_idr, worker_idr is
used for allocating/freeing ID only, so we convert it to
worker_ida.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 23 +++
1 files changed, 11 insertions(+), 12 deletions(-)
diff
: moves the pool-binding code out from create_worker() and use it for
rescuer.
Lai Jiangshan (10):
workqueue: use manager lock only to protect worker_idr
workqueue: destroy_worker() should destroy idle workers only
workqueue: async worker destruction
workqueue: destroy worker directly
, WORKER_STARTED is totally unneeded,
so we remove WORKER_STARTED too.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 19 +--
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 48a22e4..7690d0c
worker_idr is highly bound to managers and is always/only accessed in manager
lock context. So we don't need pool-lock for it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 34 ++
1 files changed, 6 insertions(+), 28 deletions
Patch1 fix a bug caused by overflow.
Patch2,3 add checks for unallocated_id.
Patch4 changes to returned error code
Patch5-8 cleanup.
Lai Jiangshan (8):
idr: fix overflow bug for the max-high layer
idr: fix unexpected id-removal when idr_remove(unallocated_id)
idr: fix NULL pointer
. It is not
a bug. But it is better to add the proper check and complains instead
of crashing the kernel.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index a28036d..d200d67 100644
--- a/lib
: -ENOENT.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index d200d67..104f87f 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -814,10 +814,10 @@ void *idr_replace(struct idr *idp, void
If idr-hint == p is true, it also implies idr-hint is true(not NULL).
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 314ea5f..08d010c 100644
--- a/lib/idr.c
+++ b/lib/idr.c
layer removal in ida_get_new*().
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c | 11 ---
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index e4f9965..be0b6ff 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -1001,17 +1001,6 @@ int
After idr subsystem is changed to RCU-awared, the free layer will not go to
the free list. The free list will not be filled up when idr_remove().
So we don't need to shink it too.
#ifndef TEST can't work for user space test now, just remove it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
When the arguments passed by the caller are invalid, WARN_ON_ONCE()
is proper than BUG_ON() which may crash the kernel.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |9 +
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index
unallocated_id, it is caller's fault. It is not
a bug. But it is better to add the proper check and complains instead
of removing an existed_id silently.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/idr.c
. But the idr_get_empty_slot() will call it
again with increased @id. So the bug is hided.
CC: sta...@vger.kernel.org
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |8 +++-
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 2642fa8..4df6792 100644
() will corrupt wq-maydays list,
and rescuer_thead() will access to corrupted data.
Using get_pwq() pin it until rescuer is done with it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 13 +
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/kernel
to free
them all(workqueuepwqs) togerther, since the rescuer is stopped.
No rescuer nor mayday-timer can access the mayday list.
But it is nasty and error-prone in future development. Fix it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 21 +++--
1
and patch description. Moved put_pwq() to after
the last @pwq-pool access. This isn't strictly necessarily for
correctness but is cleaner as the pool is accessed through the
pwq.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Signed-off-by: Tejun Heo t...@kernel.org
Cc: sta
the same problem and may incorrectly fail with
-EAGAIN; however, this bug doesn't affect correct operation because
idr_get_empty_slot(), which already uses idr_max(), retries with the
increased @id in such cases.
CC: sta...@vger.kernel.org
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
On 04/19/2014 01:17 AM, Tejun Heo wrote:
On Fri, Apr 18, 2014 at 08:49:53PM +0800, Lai Jiangshan wrote:
The ida callers always calls ida_pre_get() before ida_get_new*().
ida_pre_get() will do layer allocation, and ida_get_new*() will do layer
removal.
It causes an unneeded ping-pong
Patch1 fix a bug caused by overflow.
Patch2,3 add checks for unallocated_id.
Patch4 changes to returned error code
Patch5-9 cleanup.
Lai Jiangshan (9):
idr: fix overflow bug during maximum ID calculation at maximum height
idr: fix unexpected ID-removal when idr_remove(unallocated_id
the similar problem.
It happens only when the caller tries to free an unallocated ID which
is the caller's fault. It is not a bug. But it is better to add
the proper check and complain rather than removing an existing_id silently.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t
#ifndef TEST can't work for user space test now, just remove it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index e3c1da0..d77cdca 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -20,11
After idr subsystem is changed to RCU-awared, the free layer will not go to
the free list. The free list will not be filled up when idr_remove().
So we don't need to shink it too.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c | 16
If idr-hint == p is true, it also implies idr-hint is true(not NULL).
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 4a11c5d..e3c1da0 100644
as
ida_alloc() does.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c | 13 -
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index e79e051..317fd35 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -559,7 +559,7 @@ void idr_remove(struct
Throw away extra resources one by one
can't be achieved. This speculative layer removal in ida_get_new*() can't
result expected optimization.
So we remove the unneeded layer removal in ida_get_new*().
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c | 11 ---
1 files
: -ENOENT.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 36ff732..e79e051 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -814,10 +814,10 @@ void
-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |8 +++-
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 2642fa8..4df6792 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -249,7 +249,7 @@ static int sub_alloc
);
}
It happens only when the caller tries to free an unallocated ID which
is the caller's fault. It is not a bug. But it is better to add
the proper check and complain rather than crashing the kernel.
tj: Updated patch description.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t
On Sat, Apr 19, 2014 at 9:07 PM, Tejun Heo t...@kernel.org wrote:
On Sat, Apr 19, 2014 at 07:38:12PM +0800, Lai Jiangshan wrote:
@@ -559,7 +559,7 @@ void idr_remove(struct idr *idp, int id)
struct idr_layer *p;
struct idr_layer *to_free;
- if (id 0)
+ if (WARN_ON_ONCE
On Sat, Apr 19, 2014 at 9:01 PM, Tejun Heo t...@kernel.org wrote:
Hello,
On Sat, Apr 19, 2014 at 06:43:41PM +0800, Lai Jiangshan wrote:
On 04/19/2014 01:17 AM, Tejun Heo wrote:
It only frees one layer. And the ida_pre_get() for the next ida_get_new*()
will allocation it back again. The aim
On Sun, Apr 20, 2014 at 7:51 AM, Tejun Heo t...@kernel.org wrote:
$SUBJ: idr: remove useless #ifndef TEST
On Sat, Apr 19, 2014 at 07:38:16PM +0800, Lai Jiangshan wrote:
#ifndef TEST can't work for user space test now, just remove it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked
On 04/12/2014 06:50 PM, Lai Jiangshan wrote:
Sorry,
the cover letter was forgotten to send to LKML.
Hi, Tejun
Any comments about the patchset.
(general comments, high level comments)
Thanks.
Lai
On 04/12/2014 06:45 PM, Lai Jiangshan wrote:
Each patches remove codes!
Patch12
.
Reduce wake_up_worker() rate.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 21 +++--
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index beca98b..59bad6e 100644
--- a/kernel/workqueue.c
+++ b
.
freeze_workqueues_begin()/thaw_workqueues() skip to handle non-freezable wqs
and don't touch the non-freezable wqs' flags.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
include/linux/workqueue.h |1 +
kernel/workqueue.c| 38 --
2 files
On 04/22/2014 06:20 AM, Tejun Heo wrote:
On Mon, Apr 21, 2014 at 07:59:20PM +0800, Lai Jiangshan wrote:
Only workqueues have freezable or freezing attribution/state, not worker
pools.
But POOL_FREEZING adds a suspicious state and makes reviewers confused.
And it causes
Patch1 fix a bug caused by overflow.
Patch2,3 add checks for unallocated_id.
Patch4 changes to returned error code
Patch5-7 cleanup.
All patches are acked by Tejun.
Thanks
Lai
Lai Jiangshan (7):
idr: fix overflow bug during maximum ID calculation at maximum height
idr: fix unexpected ID
After idr subsystem is changed to RCU-awared, the free layer will not go to
the free list. The free list will not be filled up when idr_remove().
So we don't need to shink it too.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c | 16
: -ENOENT.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 36ff732..e79e051 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -814,10 +814,10 @@ void
);
}
It happens only when the caller tries to free an unallocated ID which
is the caller's fault. It is not a bug. But it is better to add
the proper check and complain rather than crashing the kernel.
tj: Updated patch description.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t
the similar problem.
It happens only when the caller tries to free an unallocated ID which
is the caller's fault. It is not a bug. But it is better to add
the proper check and complain rather than removing an existing_id silently.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t
-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |8 +++-
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 2642fa8..4df6792 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -249,7 +249,7 @@ static int sub_alloc
#ifndef TEST can't work for user space test now, just remove it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 39158ab..96bb252 100644
If idr-hint == p is true, it also implies idr-hint is true(not NULL).
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
Acked-by: Tejun Heo t...@kernel.org
---
lib/idr.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 9ed37a7..39158ab 100644
), MAX_IDR_LEVEL) idr_layers is enough.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib/idr.c |9 +++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/lib/idr.c b/lib/idr.c
index 87c98fc..871991b 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -36,8 +36,13 @@
/* Leave
is not needed any more, we use unsigned long
directly and remove all the code of alloc/free struct ida_bitmap.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
include/linux/idr.h | 15 +
lib/idr.c | 85 +-
2 files changed
patch1 is the new version of previous pathset.(it is dropped by previous
patchset, this one is new)
patch2/3 save a lot memory
Lai Jiangshan (4):
idr: proper invalid argument handling
idr: reduce the number of MAX_IDR_FREE
ida: in-place ida allocation
idr: reorder the fields
in near future.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
include/linux/idr.h | 13 -
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 3a77b33..c537c55 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
returns -ENOSPC when start == end,
but it returns -EINVAL when max start while old code returns
-ENOSPC. -EINVAL is proper here, the caller must passed wrong
arguments.
ida_simple_get()'s argument-checks are changed as the same as
idr_alloc().
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
lib
On 04/23/2014 04:46 AM, Tejun Heo wrote:
Hello,
On Tue, Apr 22, 2014 at 09:47:47AM +0800, Lai Jiangshan wrote:
Testing workqueue_freezing requires wq_pool_mutex held.
Although almost-all pwq_adjust_max_active() are called with wq_pool_mutex
held,
except workqueue_set_max_active(). But I
On 04/23/2014 04:02 AM, Tejun Heo wrote:
On Tue, Apr 22, 2014 at 06:16:20PM +0800, Lai Jiangshan wrote:
There are two stages of ida allocation/free, idr_layers and ida_bitmap.
They add unneeded foot print and memory waste.
When a single ID is first allocated from an ida, this ida requires
On 04/23/2014 03:58 AM, Tejun Heo wrote:
On Tue, Apr 22, 2014 at 06:16:19PM +0800, Lai Jiangshan wrote:
+/*
+ * Number of idr_layer structs to leave in free list.
+ * When idr is not empty, we need atmost (MAX_IDR_LEVEL - 1) idr_layers
+ * to build up and atmost (MAX_IDR_LEVEL - 1) idr_layers
On 04/23/2014 08:04 AM, Frederic Weisbecker wrote:
Hi Lai,
So actually I'll need to use apply_workqueue_attr() on the next patchset. So
I'm considering this patch.
Some comments below:
On Tue, Apr 15, 2014 at 05:58:08PM +0800, Lai Jiangshan wrote:
From
Hi, Tejun
Acked-by: Lai Jiangshan la...@cn.fujitsu.com
CC: sta...@kernel.org
Thanks,
Lai
On 04/15/2014 07:17 AM, Daeseok Youn wrote:
Use default pwq when alloc_unbound_pwq() is failed.
And remove if condition for whether pwq is same as wq-dfl_pwq
when wq_calc_node_cpumask() returns false
From 534f1df8a5a03427b0fc382150fbd34e05648a28 Mon Sep 17 00:00:00 2001
From: Lai Jiangshan la...@cn.fujitsu.com
Date: Tue, 15 Apr 2014 17:52:19 +0800
Subject: [PATCH] workqueue: allow changing attributions of ordered workqueue
Allow changing ordered workqueue's cpumask
Allow changing ordered
So IUUC this is to allow registering ordered workqueue as WQ_SYSFS? But I
think
Making ordered workqueue's attributions changeable was listed in my TODO list.
I found it may help for you, so I prioritized it.
Never mind, I will push my patch separated if you don't need it.
we are going to
On 04/16/2014 12:47 AM, Tejun Heo wrote:
On Fri, Mar 28, 2014 at 08:07:58PM +0800, Lai Jiangshan wrote:
+static inline void get_unbound_pwq(struct pool_workqueue *pwq)
+{
+if (pwq-wq-flags WQ_UNBOUND)
+get_pwq(pwq);
+}
+
/**
* put_pwq - put a pool_workqueue reference
On Wed, Apr 16, 2014 at 11:23 PM, Tejun Heo t...@kernel.org wrote:
Hello, Lai.
On Wed, Apr 16, 2014 at 09:25:16AM +0800, Lai Jiangshan wrote:
1) Our aim is to protect unbound pwq, not percpu pwq which can't be be
protected by get_pwq().
2) get_pwq() will make reviewers confused/surprised
Acked.
On Wed, Apr 16, 2014 at 1:32 PM, Daeseok Youn daeseok.y...@gmail.com wrote:
wq_update_unbound_numa() failure path has the following two bugs.
- alloc_unbound_pwq() is called without holding wq-mutex;
however, if the allocation fails, it jumps to out_unlock
which tries to unlock
On 04/17/2014 12:50 AM, Tejun Heo wrote:
Hello, Lai.
On Thu, Apr 17, 2014 at 12:21:21AM +0800, Lai Jiangshan wrote:
OK. It is better to use get_pwq(). I will also change the above comments to:
The base ref and the possible ref from rerscuer(stopped) are never
dropped on per-cpu pwqs
to free
them all(workqueuepwqs) togerther, since the rescuer is stopped.
No rescuer nor mayday-timer can access the mayday list.
But it is nasty and error-prone in future develop. Fix it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 12 ++--
1 files changed
() will corrupt wq-maydays list,
and rescuer_thead() will access to corrupted data.
Using get_pwq() pin it until rescuer is done with it.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 13 +
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/kernel
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
On Thu, Apr 17, 2014 at 11:27 PM, Tejun Heo t...@kernel.org wrote:
Hello,
On Thu, Apr 17, 2014 at 07:34:08AM +0800, Lai Jiangshan wrote:
Before the rescuer is picked to running, the works of the @pwq
may be processed by some other workers, and destroy_workqueue()
may called at the same time
On Fri, Apr 18, 2014 at 12:08 AM, Tejun Heo t...@kernel.org wrote:
Hello, Lai.
On Fri, Apr 18, 2014 at 12:04:29AM +0800, Lai Jiangshan wrote:
I don't think this is reliable. What if mayday requests take place
between wq_mayday_lock and kthread_should_stop() check? We'll
probably need
Since destroy_worker() is working atomically, we move maybe_destroy_worker()
out from manager and destroy worker directly in idle timeout handler.
And we remove %POOL_MANAGE_WORKERS which help us remove a branch in
worker_thread().
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel
to disable_workers_concurrency().
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 46 +++---
1 files changed, 15 insertions(+), 31 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index d845bdd..0b56730 100644
worker_idr, we need to add a ida back
we do not save any thing.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 15 +++
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 6c38aed..3a6be02 100644
be called at the some time. so create_and_start_worker()
don't need manager_mutex too.
All other routines don't need manager_mutex. so manager_workers()
don't need manager_mutex too.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 73
restore_workers_cpumask() also restore rescuers' cpumask via bind_list.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 129 +++
kernel/workqueue_internal.h |1 +
2 files changed, 57 insertions(+), 73 deletions
destroy_worker()
faster, but:
1) allow destroy_worker() to be called in timeout handler in future patch.
2) reduce possible latency for create_worker()/cpu-hotplug.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 32 +---
1 files changed
Sorry,
the cover letter was forgotten to send to LKML.
On 04/12/2014 06:45 PM, Lai Jiangshan wrote:
Each patches remove codes!
Patch12 are the basic patches. They add a *united* mechanism for managing
percpu pools' workers' unbound pools' workers' rescuers' CPUMASK.
Patch14 make workers
On 04/14/2014 08:58 AM, Daeseok Youn wrote:
mutex_unlock() and put_pwq_unlocked() do not need to be called
when alloc_unbound_pwq() is failed.
Signed-off-by: Daeseok Youn daeseok.y...@gmail.com
---
kernel/workqueue.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff
On 04/01/2014 04:06 AM, Tejun Heo wrote:
On Mon, Mar 31, 2014 at 10:40:47PM +0800, Lai Jiangshan wrote:
Ping
Lai, I'll keep the mail tagged but can you pleaes ping me once -rc1
drops? While it is an actual bug, given that it'd be pretty difficult
to trigger, I don't think it's too urgent
On Mon, Apr 14, 2014 at 6:41 PM, Daeseok Youn daeseok.y...@gmail.com wrote:
mutex_unlock() and put_pwq_unlocked() do not need to be called
when alloc_unbound_pwq() is failed.
And remove if condition for whether pwq is same as wq-dfl_pwq
when wq_calc_node_cpumask() returns false and just use
On 03/28/2014 01:21 AM, Frederic Weisbecker wrote:
Changing the cpu affinity of workqueues through the sysfs interface
is done with apply_workqueue_attrs() by replacing the old pwqs
of a workqueue with new ones tied to worker pools that are affine to the
new cpumask.
We can't do that with
On 03/31/2014 08:50 PM, Lai Jiangshan wrote:
On 03/28/2014 01:21 AM, Frederic Weisbecker wrote:
Changing the cpu affinity of workqueues through the sysfs interface
is done with apply_workqueue_attrs() by replacing the old pwqs
of a workqueue with new ones tied to worker pools that are affine
Ping
On 03/28/2014 08:07 PM, Lai Jiangshan wrote:
From 11af0cd0306309f0deaf3326cc26d3e7e517e3d1 Mon Sep 17 00:00:00 2001
From: Lai Jiangshan la...@cn.fujitsu.com
Date: Fri, 28 Mar 2014 00:20:12 +0800
Subject: [PATCH] workqueue: fix possible race condition when rescuer VS
pwq-release
the return value of it and adjust the call-site.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 18 +-
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index f344334..92f7ea0c 100644
--- a/kernel
worker is started.
The overhead is acceptible since the manager is slow path.
Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com
---
kernel/workqueue.c | 68 ++--
1 files changed, 13 insertions(+), 55 deletions(-)
diff --git a/kernel/workqueue.c b
Hi, TJ
These are the cleanups for which you asked during the prevous development,
especailly the patch3 merging start_worker() into create_worker().
Thanks,
Lai
Lai Jiangshan (3):
workqueue: remove the first check and the return value of
maybe_create_worker()
workqueue: remove
601 - 700 of 2229 matches
Mail list logo