Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Wed, Feb 27, 2013 at 3:30 AM, Srivatsa S. Bhat wrote: > On 02/26/2013 09:55 PM, Lai Jiangshan wrote: >> On Tue, Feb 26, 2013 at 10:22 PM, Srivatsa S. Bhat >> wrote: >>> >>> Hi Lai, >>> >>> I'm really not convinced that piggy-backing on

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 10:22 PM, Srivatsa S. Bhat wrote: > > Hi Lai, > > I'm really not convinced that piggy-backing on lglocks would help > us in any way. But still, let me try to address some of the points > you raised... > > On 02/26/2013 06:29 PM, Lai Jiangshan w

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Mon, Feb 18, 2013 at 8:38 PM, Srivatsa S. Bhat wrote: > Using global rwlocks as the backend for per-CPU rwlocks helps us avoid many > lock-ordering related problems (unlike per-cpu locks). However, global > rwlocks lead to unnecessary cache-line bouncing even when there are no > writers present

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat wrote: > Hi Lai, > > On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >> Hi, Srivatsa, >> >> The target of the whole patchset is nice for me. > > Cool! Thanks :-) > >> A question: How did you find out the

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-26 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 5:02 PM, Srivatsa S. Bhat wrote: > On 02/26/2013 05:47 AM, Lai Jiangshan wrote: >> On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat >> wrote: >>> Hi Lai, >>> >>> On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >>>> Hi, S

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 8:17 AM, Lai Jiangshan wrote: > On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat > wrote: >> Hi Lai, >> >> On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >>> Hi, Srivatsa, >>> >>> The target of the whole patchset is ni

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
On Tue, Feb 26, 2013 at 3:26 AM, Srivatsa S. Bhat wrote: > Hi Lai, > > On 02/25/2013 09:23 PM, Lai Jiangshan wrote: >> Hi, Srivatsa, >> >> The target of the whole patchset is nice for me. > > Cool! Thanks :-) > >> A question: How did you find out the

Re: [PATCH v6 04/46] percpu_rwlock: Implement the core design of Per-CPU Reader-Writer Locks

2013-02-25 Thread Lai Jiangshan
untested draft here. Thanks, Lai PS: Some HA tools(I'm writing one) which takes checkpoints of virtual-machines frequently, I guess this patchset can speedup the tools. >From 01db542693a1b7fc6f9ece45d57cb529d9be5b66 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 25 Feb 2013

[PATCH] workqueue: clear workers of a pool after the CPU is offline

2013-02-20 Thread Lai Jiangshan
edule offline_pool() to clear workers. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 109 ++- 1 files changed, 98 insertions(+), 11 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 0b1e6f2..ffdc1db 100644 --- a/k

linux-kernel@vger.kernel.org

2013-02-19 Thread Lai Jiangshan
erent implementation. On Tue, Feb 19, 2013 at 3:50 AM, Tejun Heo wrote: > Hello, Lai. > > On Tue, Feb 19, 2013 at 12:12:14AM +0800, Lai Jiangshan wrote: >> +/** >> + * get_work_cwq - get cwq of the work >> + * @work: the work item of interest >> + * >> + * CON

Re: [PATCH V2 00/15] workqueue: enhance locking and lookup worker via ID

2013-02-18 Thread Lai Jiangshan
On 19/02/13 00:12, Lai Jiangshan wrote: Core patches are patch 1, patch 9, patch 13 Patch 1: enhance locking Patch 9: recorde worker id to work->data instead of pool id lookup worker via worker ID if offq Patch 13:also lookup worker via worker ID if running&&queued,

[PATCH V2 09/15] workqueue: use worker id in work->data instead

2013-02-18 Thread Lai Jiangshan
std worker_pool, this patch solves it. This patch slows down the very-slow-path destroy_worker(), if it is required, we will move the synchronize_sched() out. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h | 20 +++--- kernel/workqueue.c| 140 ++---

[PATCH V2 05/15] workqueue: only set pool id when the work is running

2013-02-18 Thread Lai Jiangshan
When a work is dequeued via try_to_grab_pending(), its pool id is recored in work->data. but this recording is useless when the work is not running. In this patch, we only record pool id when the work is running. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 11 +-- 1 fi

[PATCH V2 04/15] workqueue: add worker's global worker ID

2013-02-18 Thread Lai Jiangshan
Add new worker->id which is allocated from worker_idr. This will be used to record the last running worker in work->data. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 28 kernel/workqueue_internal.h |1 + 2 files changed, 29 insertions

[PATCH V2 11/15] workqueue: split work_flags to delayed_flags and color_flags in __queue_work()

2013-02-18 Thread Lai Jiangshan
Allow we use delayed_flags only in different path in later patches. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7ac6824..cdd5523 100644 --- a/kernel/workqueue.c

[PATCH V2 07/15] workqueue: change argument of worker_maybe_bind_and_lock() to pool

2013-02-18 Thread Lai Jiangshan
ument. we choice the later one. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 18 +- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b47d1af..b987195 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @

[PATCH V2 08/15] workqueue: only change worker->pool with pool lock held

2013-02-18 Thread Lai Jiangshan
is de-associated to the pool. It is done with pool->lock held in ether set of above Thus we have this semantic: If pool->lock is held and worker->pool==pool, we can determine that the worker is associated to the pool now. Signed-off-by: Lai Jiangshan --- ker

[PATCH V2 10/15] workqueue: avoid unneeded calls to get_work_cwq()

2013-02-18 Thread Lai Jiangshan
Use already-known "cwq" instead of get_work_cwq(work) in try_to_grab_pending() and cwq_activate_first_delayed(). It avoid unneeded calls to get_work_cwq() which becomes not so light-way in later patches. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 11 +-- 1 files

[PATCH V2 14/15] workqueue: convert busy hash to busy list

2013-02-18 Thread Lai Jiangshan
Since we don't use the hashtable, thus we can use list to implement the for_each_busy_worker(). Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 27 ++- kernel/workqueue_internal.h |9 +++-- 2 files changed, 13 insertions(+), 23 deletions(-)

[PATCH V2 15/15] workqueue: queue worker to busy list outside process_one_work()

2013-02-18 Thread Lai Jiangshan
pool->busy_list is touched when the worker processes every work. if this code is moved out, we reduce this touch. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c in

linux-kernel@vger.kernel.org

2013-02-18 Thread Lai Jiangshan
check) get_work_cwq() requires the caller hold the pool lock and the work must be *owned* by the pool. or we can provide even more loose semantic, but we don't need loose semantic in any case currently, KISS. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h |3

[PATCH V2 12/15] workqueue: add extra flags to set_work_worker_and_keep_pending()

2013-02-18 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index cdd5523..ab5c61a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -544,9 +544,11 @@ static inline unsigned

[PATCH V2 06/15] workqueue: use current instead of worker->task in worker_maybe_bind_and_lock()

2013-02-18 Thread Lai Jiangshan
worker_maybe_bind_and_lock() uses both @task and @current and the same time, they are the same(worker_maybe_bind_and_lock() can only be called by current worker task) We make it uses @current only. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |7 +++ 1 files changed, 3

[PATCH V2 03/15] workqueue: remname current worker->id to worker->id_in_pool

2013-02-18 Thread Lai Jiangshan
We will use worker->id for global worker id. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 20 +++- kernel/workqueue_internal.h |2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f90d

[PATCH V2 02/15] workqueue: allow more work_pool id space

2013-02-18 Thread Lai Jiangshan
color bits is not used when offq, so we reuse them for pool IDs. thus we will have more pool IDs. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index

[PATCH V2 01/15] workqueue: add lock_work_pool()

2013-02-18 Thread Lai Jiangshan
ool, It will still look up the worker. But this lookup is neeeded in later patches. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 170 --- 1 files changed, 93 insertions(+), 77 deletions(-) diff --git a/kernel/workqueue.

[PATCH V2 00/15] workqueue: enhance locking and lookup worker via ID

2013-02-18 Thread Lai Jiangshan
6-8: ensure modification to worker->pool is under pool lock held Patch 14: remove hashtable totally other patch is preparing-patch or cleanup. Lai Jiangshan (15): workqueue: add lock_work_pool() workqueue: allow more work_pool id space workqueue: remname worker->id to worker->id_in_p

Re: [PATCH 2/2 wq/for-3.9] workqueue: reimplement is_chained_work() using current_wq_worker()

2013-02-16 Thread Lai Jiangshan
Hi, tj Thank you for adding this one. Would you deffer "workqueue: rename cpu_workqueue to pool_workqueue" a little? I don't want to rebase my almost-ready work again(not a good reason... but please...) I will answer your other emails soon and sent the patches. Thanks, Lai On 14/02/13 11:2

Re: [GIT PULL rcu/next] RCU commits for 3.9

2013-02-07 Thread Lai Jiangshan
Hi, Paul These (https://lkml.org/lkml/2012/11/29/123) are still not merged. Thanks, lai On 05/02/13 01:18, Paul E. McKenney wrote: Hello, Ingo, The major features of this series are: 1. Changes to rcutorture and to RCU documentation. Posted to LKML at https://lkml.org/lkml/2013

Re: [PATCH 02/13] workqueue: fix work_busy()

2013-02-06 Thread Lai Jiangshan
On Wed, Feb 6, 2013 at 2:53 AM, Tejun Heo wrote: > Hello, > > On Tue, Feb 05, 2013 at 08:06:54PM +0800, Lai Jiangshan wrote: >> >>@@ -3453,15 +3451,13 @@ unsigned int work_busy(struct work_struct *work) >> >> { >> >>struct worker_pool *pool = get_

Re: [PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

2013-02-06 Thread Lai Jiangshan
On Wed, Feb 6, 2013 at 12:45 AM, Tejun Heo wrote: > Hey, Lai. > > On Tue, Feb 05, 2013 at 11:00:42PM +0800, Lai Jiangshan wrote: >> The @cpu can be WORK_CPU_UNBOUND, and the current code will delay >> to determine on which cpu should this work be queued until timeout, >&

Re: [PATCH 00/13] workqueue: enhance locking and record global worker id for work data

2013-02-05 Thread Lai Jiangshan
On Tue, Feb 5, 2013 at 5:04 AM, Tejun Heo wrote: > Hello, Lai. > > Generally, I *really* like where you're headed but like before it's a > bit difficult for me to apply the patches as-is. Please read on. > > On Fri, Feb 01, 2013 at 02:41:23AM +0800, Lai Jiangs

Re: [PATCH 13/13] workqueue: record global worker ID instead of pool ID in work->data when off-queue

2013-02-05 Thread Lai Jiangshan
On Tue, Feb 5, 2013 at 6:12 AM, Tejun Heo wrote: > Hello, > > One more thing. > > On Fri, Feb 01, 2013 at 02:41:36AM +0800, Lai Jiangshan wrote: >> @@ -1216,7 +1198,11 @@ static int try_to_grab_pending(struct work_struct >> *work, bool is_dwork, >>

Re: [PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

2013-02-05 Thread Lai Jiangshan
于 2013/2/5 5:28, Tejun Heo 写道: > Hello, again. > > On Fri, Feb 01, 2013 at 02:41:26AM +0800, Lai Jiangshan wrote: >> @@ -110,6 +110,7 @@ struct delayed_work { >> struct work_struct work; >> struct timer_list timer; >> int cpu; >> +struct

Re: [PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

2013-02-05 Thread Lai Jiangshan
于 2013/2/5 5:28, Tejun Heo 写道: Hello, again. On Fri, Feb 01, 2013 at 02:41:26AM +0800, Lai Jiangshan wrote: @@ -110,6 +110,7 @@ struct delayed_work { struct work_struct work; struct timer_list timer; int cpu; + struct workqueue_struct *wq; Can't we just re

Re: [PATCH 08/13] workqueue: add lock_pool_executing_work()

2013-02-05 Thread Lai Jiangshan
于 2013/2/5 5:34, Tejun Heo 写道: Hello, On Fri, Feb 01, 2013 at 02:41:31AM +0800, Lai Jiangshan wrote: +static struct worker_pool *lock_pool_executing_work(struct work_struct *work, + struct worker **worker) +{ + unsigned long pool_id

Re: [PATCH 02/13] workqueue: fix work_busy()

2013-02-05 Thread Lai Jiangshan
于 2013/2/5 3:54, Tejun Heo 写道: Hello, Lai. On Fri, Feb 01, 2013 at 02:41:25AM +0800, Lai Jiangshan wrote: diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 973b290..d474a6c 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3443,8 +3443,6 @@ EXPORT_SYMBOL_GPL

Re: [PATCH 01/13] workqueue: remove WORK_CPU_NONE

2013-02-05 Thread Lai Jiangshan
于 2013/2/5 3:49, Tejun Heo 写道: Hello, Lai. On Fri, Feb 01, 2013 at 02:41:24AM +0800, Lai Jiangshan wrote: In __next_wq_cpu() for_each_*wq_cpu(), the name WORK_CPU_LAST is proper than WORK_CPU_NONE, convert them to WORK_CPU_LAST. WORK_CPU_NONE is not used any more, just remove it

[PATCH 03/13] workqueue: don't set work cwq until we queued it on pool

2013-01-31 Thread Lai Jiangshan
work.entry, this patch and the later two patches make this encoding possible.) This is the first step of killing CWQ bit of the work which is not queued on any pool. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h |1 + kernel/workqueue.c| 32 +++--

[PATCH 04/13] workqueue: clear cwq when cancel the work

2013-01-31 Thread Lai Jiangshan
Add clear_work_cwq() which clear the CWQ bit when the work is offq when it is cancelled. It is the other important step of killing CWQ bit of the work which is not queued on any pool. Now, when a work is offq, it has no CWQ bit. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |7

[PATCH 05/13] workqueue: change queued detection and remove *mb()s

2013-01-31 Thread Lai Jiangshan
Now, we has this invariant: CWQ bit is set and the cwq->pool == pool <==> the work is queued on the pool So we can simplify the work-queued-detection-and-lock and remove *mb()s. (Although rmb()/wmb() is nop in x86, but it is very slow in other arch.) Signed-off-by: Lai

[PATCH 07/13] workqueue: get pool from wq/cwq

2013-01-31 Thread Lai Jiangshan
__queue_work() calls to get_std_worker_pool(), it is indirectly, we should get it directly from wq/cwq. It is needed when we introduce non-std worker pool. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel

[PATCH 08/13] workqueue: add lock_pool_executing_work()

2013-01-31 Thread Lai Jiangshan
__queue_work(): even worker_pool_by_id(pool_id) == get_cwq(cpu, wq)->pool, It will still call find_worker_executing_work() unconditionally, but it is it is a very small overhead compared to the lockings and worker_pool_by_id(), and this overhead will be reduced later. Signed-off-by: Lai Jiangs

[PATCH 01/13] workqueue: remove WORK_CPU_NONE

2013-01-31 Thread Lai Jiangshan
In __next_wq_cpu() for_each_*wq_cpu(), the name WORK_CPU_LAST is proper than WORK_CPU_NONE, convert them to WORK_CPU_LAST. WORK_CPU_NONE is not used any more, just remove it. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h |3 +-- kernel/workqueue.c|8 2

[PATCH 09/13] workqueue: add lock_pool_queued_work()

2013-01-31 Thread Lai Jiangshan
Extract lock code from try_to_grab_pending() and name it lock_pool_queued_work(). It makes the code better readability and make try_to_grab_pending() shorter, And this new function can be reused by other(later patch). Add/Use proper locking API. Signed-off-by: Lai Jiangshan --- kernel

[PATCH 10/13] workqueue: add lock_pool_own_work() and remove get_work_pool()

2013-01-31 Thread Lai Jiangshan
k and it is not used any more, just remove it. Add/Use proper locking API. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 123 ++-- 1 files changed, 62 insertions(+), 61 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c in

[PATCH 02/13] workqueue: fix work_busy()

2013-01-31 Thread Lai Jiangshan
Even get_work_pool() return NULL, the work may be pending. Make work_pending() test unconditionally. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 973b290..d474a6c

[PATCH 11/13] workqueue: allow more work_pool id space

2013-01-31 Thread Lai Jiangshan
color bits is not used when offq, so we reuse them for pool IDs. thus we will have more pool IDs. Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index

[PATCH 00/13] workqueue: enhance locking and record global worker id for work data

2013-01-31 Thread Lai Jiangshan
d search worker from hash. We record global worker id for work data and we only need one search. --PATCH 13 cleanup --PATCH 1,2,7,11 On top of tj/for-3.9 706026c2141113886f61e1ad2738c9a7723ec69c Lai Jiangshan (13): workqueue: remove WORK_CPU_NONE workqueue: fix work_busy() w

[PATCH 13/13] workqueue: record global worker ID instead of pool ID in work->data when off-queue

2013-01-31 Thread Lai Jiangshan
hed instead. (local_irq_disable() implies rcu_read_lock_sched(), so we can remove this overhead.) Signed-off-by: Lai Jiangshan --- include/linux/workqueue.h | 18 +++--- kernel/workqueue.c| 126 - 2 files changed, 65 insertions(+), 79 deletions(-) diff --gi

[PATCH 06/13] workqueue: get pool id from work->data directly if it is offq

2013-01-31 Thread Lai Jiangshan
We know that when the time of the two calls of get_work_pool_id(), the work is offq, so we can get pool id from work->data directly and remove the overhead of idr_find() called by get_work_pool_id(). Implement offq_work_pool_id() instead of get_work_pool_id(). Signed-off-by: Lai Jiangs

[PATCH 12/13] workqueue: add worker's global worker ID

2013-01-31 Thread Lai Jiangshan
Add worker->gwid which is allocated from worker_idr. This will be used to record the last running worker in work->data. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 28 kernel/workqueue_internal.h |1 + 2 files changed, 29 insertions

Re: [PATCHSET] workqueue: remove gcwq and make worker_pool the only backend abstraction

2013-01-24 Thread Lai Jiangshan
git/tj/wq.git for-3.9-remove-gcwq For the whole patchset Reviewed-by: Lai Jiangshan The only concern: get_work_pool() may slow down __queue_work(). I think we can save the pool->id at work_struct->entry.next, It will simply the code a little. More aggressive, we can save the work_pool

Re: [PATCH 1/2] memory-hotplug: Add help info for CONFIG_MOVABLE_NODE option

2012-12-14 Thread Lai Jiangshan
fine > + with this option on since they don't online memory as movable. > + > + Say Y here if you want to hotplug a whole node. > + Say N here if you want kernel to use memory on all nodes evenly. Thank you for adding the help text which should have been done

Re: [PATCH v2 0/5] Add movablecore_map boot option

2012-11-30 Thread Lai Jiangshan
On 11/28/2012 12:08 PM, Jiang Liu wrote: > On 2012-11-28 11:24, Bob Liu wrote: >> On Tue, Nov 27, 2012 at 8:49 PM, Tang Chen wrote: >>> On 11/27/2012 08:09 PM, Bob Liu wrote: On Tue, Nov 27, 2012 at 4:29 PM, Tang Chen wrote: > > Hi Liu, > > > This feature is used

Re: [PATCH 8/8] srcu: use ACCESS_ONCE() to access sp->completed in srcu_read_lock()

2012-11-30 Thread Lai Jiangshan
On 11/30/2012 06:05 AM, Paul E. McKenney wrote: > On Thu, Nov 29, 2012 at 04:46:09PM +0800, Lai Jiangshan wrote: >> Old srcu implement requires sp->completed is loaded in >> RCU-sched(preempt_disable()) section. >> >> The new srcu is now not RCU-sched based, it doe

[PATCH 3/8] srcu: simple cleanup for cleanup_srcu_struct()

2012-11-29 Thread Lai Jiangshan
Pack 6 lines of code into 2 lines. Signed-off-by: Lai Jiangshan --- kernel/srcu.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c index 48d0edb..ac08970 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -278,12 +278,8 @@ static int

[PATCH 2/8] srcu: add might_sleep() annotation to synchronize_srcu()

2012-11-29 Thread Lai Jiangshan
synchronize_srcu() can sleep but it will not sleep if the fast path succeeds. This annotation will helps us to catch the problem early if it is called in a wrong contex which can't sleep. Signed-off-by: Lai Jiangshan --- kernel/srcu.c |1 + 1 files changed, 1 insertions(+), 0 dele

[PATCH 0/8] srcu: cleanup for 3.8

2012-11-29 Thread Lai Jiangshan
Hi, Paul These are tiny cleanups for srcu. PATCH 4~8 make the code or the comments match the new SRCU. Thanks, Lai Lai Jiangshan (8): srcu: simplify __srcu_read_unlock() via this_cpu_dec() srcu: add might_sleep() annotation to synchronize_srcu() srcu: simple cleanup for

[PATCH 5/8] srcu: srcu_read_lock() can be called from idle loop

2012-11-29 Thread Lai Jiangshan
Do you need read-side critical sections that are respected even though they are in the middle of the idle loop, during user-mode execution, or on an offlined CPU? If so, SRCU is the only choice that will work for you. Signed-off-by: Lai Jiangshan --- include/linux/s

[PATCH 4/8] srcu: srcu_read_lock() can be called from offline cpu

2012-11-29 Thread Lai Jiangshan
Do you need read-side critical sections that are respected even though they are in the middle of the idle loop, during user-mode execution, or on an offlined CPU? If so, SRCU is the only choice that will work for you. Signed-off-by: Lai Jiangshan --- include/linux/s

[PATCH 6/8] srcu: update the comments of synchronize_srcu()

2012-11-29 Thread Lai Jiangshan
The core of srcu is changed, but the comments of synchronize_srcu() describe the old algorithm. Update it to match the new algorithm. Signed-off-by: Lai Jiangshan --- kernel/srcu.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c

[PATCH 8/8] srcu: use ACCESS_ONCE() to access sp->completed in srcu_read_lock()

2012-11-29 Thread Lai Jiangshan
ched_held() here?" Signed-off-by: Lai Jiangshan --- kernel/srcu.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c index 38a762f..224400a 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -294,9 +294,8 @@ int __srcu_read_lock(s

[PATCH 7/8] srcu: update the comments of synchronize_srcu_expedited()

2012-11-29 Thread Lai Jiangshan
ned-off-by: Lai Jiangshan --- kernel/srcu.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c index 55524f6..38a762f 100644 --- a/kernel/srcu.c +++ b/kernel/srcu.c @@ -471,12 +471,11 @@ EXPORT_SYMBOL_GPL(synchronize_srcu); * Wait f

[PATCH 1/8] srcu: simplify __srcu_read_unlock() via this_cpu_dec()

2012-11-29 Thread Lai Jiangshan
this_cpu_dec() can do the same thing and sometimes it is better. (avoid preempt_disable() and use more tiny instructions) Signed-off-by: Lai Jiangshan --- kernel/srcu.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/kernel/srcu.c b/kernel/srcu.c index b363b09

[V5 PATCH 21/26] page_alloc: add kernelcore_max_addr

2012-10-29 Thread Lai Jiangshan
2 of them). Signed-off-by: Lai Jiangshan --- Documentation/kernel-parameters.txt |9 + mm/page_alloc.c | 29 - 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-para

[V5 PATCH 11/26] mempolicy: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan --- mm/mempolicy.c | 12 ++-- 1 files

[V5 PATCH 16/26] vmscan: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Hillf Danton --- mm/vmscan.c |4

[V5 PATCH 02/26] memory_hotplug: handle empty zone when online_movable/online_kernel

2012-10-29 Thread Lai Jiangshan
make online_movable/online_kernel can empty a zone or can move memory to a empty zone. Signed-off-by: Lai Jiangshan --- mm/memory_hotplug.c | 51 +-- 1 files changed, 45 insertions(+), 6 deletions(-) diff --git a/mm/memory_hotplug.c b/mm

[V5 PATCH 06/26] cpuset: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Hillf Danton --- Documentation/cgroups

[V5 PATCH 15/26] init: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan --- init/main.c |2 +- 1 files changed, 1

[V5 PATCH 26/26] mempolicy: fix is_valid_nodemask()

2012-10-29 Thread Lai Jiangshan
for policies. is_valid_nodemask() need to be changed to match it. Fix: check all zones, even its zoneid > policy_zone. Use nodes_intersects() instead open code to check it. Signed-off-by: Lai Jiangshan Reported-by: Wen Congyang --- mm/mempolicy.c | 36 ++-- 1

[V5 PATCH 10/26] mm,migrate: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Christoph Lameter --- mm/migrate.c |2

[V5 PATCH 22/26] x86: get pg_data_t's memory from other node

2012-10-29 Thread Lai Jiangshan
suaki Ishimatsu Signed-off-by: Lai Jiangshan --- arch/x86/mm/numa.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 2d125be..a86e315 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -223,9 +223,13 @@ static void _

[V5 PATCH 25/26] memblock: compare current_limit with end variable at memblock_find_in_range_node()

2012-10-29 Thread Lai Jiangshan
"memblock_find_in_range_node()" Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Lai Jiangshan --- mm/memblock.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index ee2e307..50ab53c 100644 --- a/mm/memblock.c +++ b/mm/memblock.c

[V5 PATCH 14/26] kthread: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan --- kernel/kthread.c |2 +- 1 files changed, 1

[V5 PATCH 23/26] x86: use memblock_set_current_limit() to set memblock.current_limit

2012-10-29 Thread Lai Jiangshan
From: Yasuaki Ishimatsu memblock.current_limit is set directly though memblock_set_current_limit() is prepared. So fix it. Signed-off-by: Yasuaki Ishimatsu Signed-off-by: Lai Jiangshan --- arch/x86/kernel/setup.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a

[V5 PATCH 12/26] hugetlb: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Hillf Danton --- drivers/base/node.c

[V5 PATCH 07/26] procfs: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Hillf Danton --- fs/proc/kcore.c

[V5 PATCH 05/26] node_states: introduce N_MEMORY

2012-10-29 Thread Lai Jiangshan
In one word, we need a N_MEMORY. We just intrude it as an alias to N_HIGH_MEMORY and fix all im-proper usages of N_HIGH_MEMORY in late patches. Signed-off-by: Lai Jiangshan Acked-by: Christoph Lameter Acked-by: Hillf Danton --- include/linux/nodemask.h |1 + 1 files changed, 1 insertions(+

[V5 PATCH 18/26] hotplug: update nodemasks management

2012-10-29 Thread Lai Jiangshan
update nodemasks management for N_MEMORY Signed-off-by: Lai Jiangshan --- Documentation/memory-hotplug.txt |5 ++- include/linux/memory.h |1 + mm/memory_hotplug.c | 87 +++--- 3 files changed, 77 insertions(+), 16 deletions

[V5 PATCH 24/26] memblock: limit memory address from memblock

2012-10-29 Thread Lai Jiangshan
Signed-off-by: Lai Jiangshan --- include/linux/memblock.h |1 + mm/memblock.c|5 - mm/page_alloc.c |6 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/memblock.h b/include/linux/memblock.h index d452ee1..3e52911 100644 --- a

[V5 PATCH 19/26] numa: add CONFIG_MOVABLE_NODE for movable-dedicated node

2012-10-29 Thread Lai Jiangshan
All are prepared, we can actually introduce N_MEMORY. add CONFIG_MOVABLE_NODE make we can use it for movable-dedicated node Signed-off-by: Lai Jiangshan --- drivers/base/node.c |6 ++ include/linux/nodemask.h |4 mm/Kconfig |8 mm/page_alloc.c

[V5 PATCH 08/26] memcontrol: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan --- mm/memcontrol.c | 18 +- mm

[V5 PATCH 17/26] page_alloc: use N_MEMORY instead N_HIGH_MEMORY change the node_states initialization

2012-10-29 Thread Lai Jiangshan
-off-by: Lai Jiangshan --- arch/x86/mm/init_64.c |4 +++- mm/page_alloc.c | 40 ++-- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 3baff25..2ead3c8 100644 --- a/arch/x86/mm/init_64

[V5 PATCH 13/26] vmstat: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Christoph Lameter --- mm/vmstat.c |4

[V5 PATCH 04/26] node: cleanup node_state_attr

2012-10-29 Thread Lai Jiangshan
use [index] = init_value use N_x instead of hardcode. Make it more readability and easy to add new state. Signed-off-by: Lai Jiangshan --- drivers/base/node.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/base/node.c b/drivers/base

[V5 PATCH 09/26] oom: use N_MEMORY instead N_HIGH_MEMORY

2012-10-29 Thread Lai Jiangshan
N_HIGH_MEMORY stands for the nodes that has normal or high memory. N_MEMORY stands for the nodes that has any memory. The code here need to handle with the nodes which have memory, we should use N_MEMORY instead. Signed-off-by: Lai Jiangshan Acked-by: Hillf Danton --- mm/oom_kill.c |2

[V5 PATCH 20/26] memory_hotplug: allow online/offline memory to result movable node

2012-10-29 Thread Lai Jiangshan
vable-node is very important for power-saving, hardware partitioning and high-available-system(hardware fault management). Signed-off-by: Lai Jiangshan --- mm/memory_hotplug.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/mm/memory_hotplug.c

[V5 PATCH 03/26] memory_hotplug: ensure every online node has NORMAL memory

2012-10-29 Thread Lai Jiangshan
n't create task or create other kernel object. So we disable non-normal-memory-node here, we will enable it when we prepared. Signed-off-by: Lai Jiangshan --- mm/memory_hotplug.c | 40 1 files changed, 40 insertions(+), 0 deletions(-)

[V5 PATCH 01/26] mm, memory-hotplug: dynamic configure movable memory and portion memory

2012-10-29 Thread Lai Jiangshan
rysection is onlined by "online_movable", the kernel will not have directly reference to the page of the memoryblock, thus we can remove that memory any time when needed. When it is online by "online_kernel", the kernel can use it. When it is online by "online", the zone

[V5 PATCH 00/26] mm, memory-hotplug: dynamic configure movable memory and introduce movable node

2012-10-29 Thread Lai Jiangshan
ms. The orignal V1 patchset of "add online_movable" is here: https://lkml.org/lkml/2012/7/4/145 The new V2 discards the MIGRATE_HOTREMOVE approach, and use a more straight implementation(only 1 patch). Lai Jiangshan (22): mm, memory-hotplug: dynamic configure movable memory and port

[PATCH] page_alloc: fix the incorrect adjustment to zone->present_pages

2012-10-26 Thread Lai Jiangshan
d even makes page-reclaim/watermark worse. It is against its original purpose/reason. This adjustment is incorrect/buggy, subtracts unrelated value and violates its original purpose, so we simply remove the adjustment. CC: Mel Gorman Signed-off-by: Lai Jiangshan --- mm/page_alloc.c | 20 +

Re: [PATCH 1/2 V2] memory_hotplug: fix possible incorrect node_states[N_NORMAL_MEMORY]

2012-10-25 Thread Lai Jiangshan
On 10/25/2012 12:17 PM, KOSAKI Motohiro wrote: > On Wed, Oct 24, 2012 at 5:43 AM, Lai Jiangshan wrote: >> Currently memory_hotplug only manages the node_states[N_HIGH_MEMORY], >> it forgets to manage node_states[N_NORMAL_MEMORY]. it may cause >> node_states[N_NORMAL_MEMO

Re: [PATCH 1/3] memory_hotplug: fix stale node_states[N_NORMAL_MEMORY]

2012-10-25 Thread Lai Jiangshan
Hi, KOSAKI On 09/28/2012 06:03 AM, KOSAKI Motohiro wrote: > (9/27/12 2:47 AM), Lai Jiangshan wrote: >> Currently memory_hotplug only manages the node_states[N_HIGH_MEMORY], >> it forgets to manage node_states[N_NORMAL_MEMORY]. it causes >> node_states[N_NORMAL_MEMORY] becom

[PATCH 0/2 V2] memory_hotplug: fix memory hotplug bug

2012-10-24 Thread Lai Jiangshan
nux-kernel@vger.kernel.org CC: linux...@kvack.org Lai Jiangshan (2): memory_hotplug: fix possible incorrect node_states[N_NORMAL_MEMORY] slub, hotplug: ignore unrelated node's hot-adding and hot-removing Documentation/memory-hotplug.txt |5 +- include/linux/memory.h |1 + mm/m

[PATCH 1/2 V2] memory_hotplug: fix possible incorrect node_states[N_NORMAL_MEMORY]

2012-10-24 Thread Lai Jiangshan
ro CC: Yasuaki Ishimatsu CC: Rob Landley CC: Andrew Morton CC: Jiang Liu CC: Kay Sievers CC: Greg Kroah-Hartman CC: Mel Gorman CC: 'FNST-Wen Congyang' CC: linux-...@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux...@kvack.org Signed-off-by: Lai Jiangshan --- Documen

[PATCH 2/2 V2] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

2012-10-24 Thread Lai Jiangshan
#x27; CC: linux-...@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux...@kvack.org Signed-off-by: Lai Jiangshan --- mm/slub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index a0d6984..487f0bd 100644 --- a/mm/slub.c +++ b/mm/s

Re: [PATCH 2/3] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

2012-10-24 Thread Lai Jiangshan
On 09/29/2012 06:26 AM, KOSAKI Motohiro wrote: > On Fri, Sep 28, 2012 at 3:19 AM, Lai Jiangshan wrote: >> HI, Christoph, KOSAKI >> >> SLAB always allocates kmem_list3 for all nodes(N_HIGH_MEMORY), also node >> bug/bad things happens. >> SLUB always requires km

Re: [PATCH] percpu-rwsem: use barrier in unlock path

2012-10-17 Thread Lai Jiangshan
On 10/18/2012 04:28 AM, Steven Rostedt wrote: > On Wed, Oct 17, 2012 at 11:07:21AM -0400, Mikulas Patocka wrote: >>> >>> Even the previous patch is applied, percpu_down_read() still >>> needs mb() to pair with it. >> >> percpu_down_read uses rcu_read_lock which should guarantee that memory >> acce

<    5   6   7   8   9   10   11   12   13   >