[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 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 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 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 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 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 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 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 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 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 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 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

Re: [PATCH 5/8] rcu: eliminate deadlock for rcu read site

2013-08-25 Thread Lai Jiangshan
On 08/26/2013 01:43 AM, Paul E. McKenney wrote: > On Sun, Aug 25, 2013 at 11:19:37PM +0800, Lai Jiangshan wrote: >> Hi, Steven >> >> Any comments about this patch? > > For whatever it is worth, it ran without incident for two hours worth > of rcutorture on my P5 tes

Re: [PATCH tip/core/rcu 8/9] nohz_full: Add full-system-idle state machine

2013-08-25 Thread Lai Jiangshan
of > CPUs in a "small" system is defined by a new NO_HZ_FULL_SYSIDLE_SMALL > Kconfig parameter, which defaults to 8. Note that this is a build-time > definition. > > Signed-off-by: Paul E. McKenney > Cc: Frederic Weisbecker > Cc: Steven Rostedt > Cc: Lai Jian

Re: [PATCH tip/core/rcu 8/9] nohz_full: Add full-system-idle state machine

2013-08-26 Thread Lai Jiangshan
On 08/27/2013 12:24 AM, Paul E. McKenney wrote: > On Mon, Aug 26, 2013 at 01:45:32PM +0800, Lai Jiangshan wrote: >> On 08/20/2013 10:47 AM, Paul E. McKenney wrote: >>> From: "Paul E. McKenney" >>> >>> This commit adds the state machine that takes the

Re: [PATCH 09/11 V5] workqueue: rebind newly created worker

2012-09-05 Thread Lai Jiangshan
On Wed, Sep 5, 2012 at 6:37 PM, Lai Jiangshan wrote: > when the newly created needs to be rebound. exile it! > it will rebind itself in worker_thead(). > > It just prepares, this code is useless until > "we unbind/rebind without manager_mutex" > > Signed-off-by:

Re: [PATCH 05/11 V5] workqueue: Add @bind arguement back without change any thing

2012-09-05 Thread Lai Jiangshan
On 09/06/2012 03:49 AM, Tejun Heo wrote: > Hello, > > On Wed, Sep 05, 2012 at 06:37:42PM +0800, Lai Jiangshan wrote: >> Ensure the gcwq->flags is only accessed with gcwq->lock held. >> And make the code more easier to understand. >> >> In all current cal

Re: [PATCH 02/11 V5] workqueue: async idle rebinding

2012-09-05 Thread Lai Jiangshan
it is too complicated for 3.6. > > On Wed, Sep 05, 2012 at 06:37:39PM +0800, Lai Jiangshan wrote: >> static void idle_worker_rebind(struct worker *worker) >> { >> struct global_cwq *gcwq = worker->pool->gcwq; >> >> -/* CPU must be online at this p

Re: [PATCH 2/2] workqueue: fix possible deadlock in idle worker rebinding

2012-09-05 Thread Lai Jiangshan
On 09/06/2012 07:11 AM, Tejun Heo wrote: > On Tue, Sep 04, 2012 at 11:16:32PM -0700, Tejun Heo wrote: >> Currently, rebind_workers() and idle_worker_rebind() are two-way >> interlocked. rebind_workers() waits for idle workers to finish >> rebinding and rebound idle workers wait for rebind_workers(

Re: [PATCH 04/10 V4] workqueue: add manage_workers_slowpath()

2012-09-05 Thread Lai Jiangshan
On 09/05/2012 09:12 AM, Tejun Heo wrote: > Hello, Lai. > > On Sun, Sep 02, 2012 at 12:28:22AM +0800, Lai Jiangshan wrote: >> If hotplug code grabbed the manager_mutex and worker_thread try to create >> a worker, the manage_worker() will return false and worker_thread go to

Re: [PATCH 03/11 V5] workqueue: new day don't need WORKER_REBIND for busy rebinding

2012-09-05 Thread Lai Jiangshan
On 09/06/2012 02:31 AM, Tejun Heo wrote: > On Wed, Sep 05, 2012 at 06:37:40PM +0800, Lai Jiangshan wrote: >> because old busy_worker_rebind_fn() have to wait until all idle worker >> finish. >> so we have to use two flags WORKER_UNBOUND and WORKER_REBIND to avoid >

Re: [RFC v2] memory-hotplug: remove MIGRATE_ISOLATE from free_area->free_list

2012-09-06 Thread Lai Jiangshan
On 09/06/2012 10:53 AM, Minchan Kim wrote: > Normally, MIGRATE_ISOLATE type is used for memory-hotplug. > But it's irony type because the pages isolated would exist > as free page in free_area->free_list[MIGRATE_ISOLATE] so people > can think of it as allocatable pages but it is *never* allocatable

Re: [RFC v2] memory-hotplug: remove MIGRATE_ISOLATE from free_area->free_list

2012-09-06 Thread Lai Jiangshan
On 09/06/2012 04:18 PM, Minchan Kim wrote: > Hello Lai, > > On Thu, Sep 06, 2012 at 04:14:51PM +0800, Lai Jiangshan wrote: >> On 09/06/2012 10:53 AM, Minchan Kim wrote: >>> Normally, MIGRATE_ISOLATE type is used for memory-hotplug. >>> But it's irony type

Re: [RFC v2] memory-hotplug: remove MIGRATE_ISOLATE from free_area->free_list

2012-09-06 Thread Lai Jiangshan
On 09/06/2012 04:18 PM, Minchan Kim wrote: > Hello Lai, > > On Thu, Sep 06, 2012 at 04:14:51PM +0800, Lai Jiangshan wrote: >> On 09/06/2012 10:53 AM, Minchan Kim wrote: >>> Normally, MIGRATE_ISOLATE type is used for memory-hotplug. >>> But it's irony type

Re: [PATCH 10/11 V5] workqueue: unbind/rebind without manager_mutex

2012-09-06 Thread Lai Jiangshan
On 09/06/2012 04:04 AM, Tejun Heo wrote: > Hello, Lai. > > On Wed, Sep 05, 2012 at 06:37:47PM +0800, Lai Jiangshan wrote: >> gcwq_unbind_fn() unbind manager by ->manager pointer. >> >> rebinding-manger, unbinding/rebinding newly created worker are done by &g

Re: [PATCH wq/for-3.6-fixes 3/3] workqueue: fix possible idle worker depletion during CPU_ONLINE

2012-09-06 Thread Lai Jiangshan
_relax(); goto again; } /* release manager positions */ static void gcwq_release_management_and_unlock(struct global_cwq *gcwq) { struct worker_pool *pool; for_each_worker_pool(pool, gcwq) mutex_unlock(&pool->manager_mutex); spin_unlock_irq(&am

Re: [PATCH 05/11 V5] workqueue: Add @bind arguement back without change any thing

2012-09-06 Thread Lai Jiangshan
On 09/07/2012 12:51 AM, Tejun Heo wrote: > Hello, Lai. > > On Thu, Sep 06, 2012 at 09:04:06AM +0800, Lai Jiangshan wrote: >>> This doesn't change anything. You're just moving the test to the >>> caller with comments there explaining how it won't chan

Re: [PATCH wq/for-3.6-fixes 3/3] workqueue: fix possible idle worker depletion during CPU_ONLINE

2012-09-06 Thread Lai Jiangshan
On 09/07/2012 04:08 AM, Tejun Heo wrote: >>From 985aafbf530834a9ab16348300adc7cbf35aab76 Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Thu, 6 Sep 2012 12:50:41 -0700 > > To simplify both normal and CPU hotplug paths, while CPU hotplug is in > progress, manager_mutex is held to prevent one of

[PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
rebase if I don't need to respin the patchset as V7 ?) Patch3,4 fix depletion problem, it is simple enough. it goes to 3.6. Patch 5,6,7 are clean up. -> 3.7 Lai Jiangshan (7): workqueue: ensure the wq_worker_sleeping() see the right flags workqueue: async idle rebinding workque

[PATCH 3/7 V6] workqueue: add manager pointer for worker_pool

2012-09-08 Thread Lai Jiangshan
t;manager on worker_pool and let hotplug code(gcwq_unbind_fn()) handle it. also fix too_many_workers() to use this pointer. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/wo

[PATCH 1/7 V6] workqueue: ensure the wq_worker_sleeping() see the right flags

2012-09-08 Thread Lai Jiangshan
ngly do local wake up. so we use one write/modify instruction explicitly instead. This bug will not occur on idle workers, because they have another WORKER_NOT_RUNNING flags. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-)

[PATCH 6/7 V6] workqueue: new day don't need WORKER_REBIND for busy rebinding

2012-09-08 Thread Lai Jiangshan
eed to use two flags, just one is enough. remove WORKER_REBIND from busy rebinding. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c |9 + 1 files changed, 1 insertions(+), 8 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index d9765c4..4863162 100644 --

[PATCH 5/7 V6] workqueue: rename manager_mutex to assoc_mutex

2012-09-08 Thread Lai Jiangshan
moved to the bottom of manage_workers(). Other result of narrowed C.S. manager_workers() becomes simpler. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 63 1 files changed, 29 insertions(+), 34 deletions(-) diff --git a/kernel/workqu

[PATCH 4/7 V6] workqueue: fix idle worker depletion

2012-09-08 Thread Lai Jiangshan
rectly, worker rebind itself when it is noticed. Manager worker will be noticed by the bit of GCWQ_DISASSOCIATED and WORKER_UNBIND. Because the %UNBOUND bit of manager can't be cleared while it is managing workers. maybe_rebind_manager() will be noticed when rebind_workers() happens. Signed-of

[PATCH 7/7 V6] workqueue: remove WORKER_REBIND

2012-09-08 Thread Lai Jiangshan
of workers. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 21 - 1 files changed, 8 insertions(+), 13 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4863162..aa46308 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c

[PATCH 2/7 V6] workqueue: async idle rebinding

2012-09-08 Thread Lai Jiangshan
and don't release gcwq->lock. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 100 +--- 1 files changed, 25 insertions(+), 75 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 050b2a5..3dd7ce2 100644 --- a/kernel/

Re: [PATCH wq/for-3.6-fixes 3/3] workqueue: fix possible idle worker depletion during CPU_ONLINE

2012-09-08 Thread Lai Jiangshan
On Sat, Sep 8, 2012 at 7:41 AM, Tejun Heo wrote: > I think this should do it. Can you spot any hole with the following > patch? > > Thanks. > > Index: work/kernel/workqueue.c > === > --- work.orig/kernel/workqueue.c > +++ work/kernel

Re: [PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:27 AM, Lai Jiangshan wrote: > On Sun, Sep 9, 2012 at 1:12 AM, Lai Jiangshan wrote: >> The patch set is based on 3b07e9ca26866697616097044f25fbe53dbab693 of wq.git >> >> Patch 1,2 are accepted. Patch 1 goes to 3.6. tj has a replacement goes >>

Re: [PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:12 AM, Lai Jiangshan wrote: > The patch set is based on 3b07e9ca26866697616097044f25fbe53dbab693 of wq.git > > Patch 1,2 are accepted. Patch 1 goes to 3.6. tj has a replacement goes > to 3.6 instead of Patch 2. so Patch2 will go to 3.7. Patch2 will need > t

Re: [PATCH wq/for-3.6-fixes 3/3] workqueue: fix possible idle worker depletion during CPU_ONLINE

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:32 AM, Tejun Heo wrote: > On Sat, Sep 08, 2012 at 10:29:50AM -0700, Tejun Heo wrote: >> > hotplug code can't iterate manager. not rebind_work() nor UNBOUND for >> > manager. >> >> Ah, right. It isn't either on idle or busy list. Maybe have >> pool->manager pointer? > >

Re: [PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:37 AM, Tejun Heo wrote: > Hello, Lai. > > On Sun, Sep 09, 2012 at 01:27:37AM +0800, Lai Jiangshan wrote: >> On Sun, Sep 9, 2012 at 1:12 AM, Lai Jiangshan wrote: >> > The patch set is based on 3b07e9ca26866697616097044f25fbe53dbab693 of >>

Re: [PATCH 4/7 V6] workqueue: fix idle worker depletion

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:40 AM, Tejun Heo wrote: > Hello, Lai. > > On Sun, Sep 09, 2012 at 01:12:53AM +0800, Lai Jiangshan wrote: >> +/* does the manager need to be rebind after we just release gcwq->lock */ >> +static void maybe_rebind_manager(struct worker *manage

Re: [PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:50 AM, Tejun Heo wrote: > Hello, Lai. > > On Sun, Sep 09, 2012 at 01:46:59AM +0800, Lai Jiangshan wrote: >> > * Instead of MANAGING, add pool->manager. >> > >> > * Fix the idle depletion bug by using pool->manager for

Re: [PATCH 4/7 V6] workqueue: fix idle worker depletion

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 1:53 AM, Tejun Heo wrote: > Hello, > > On Sun, Sep 09, 2012 at 01:50:41AM +0800, Lai Jiangshan wrote: >> >> + if (worker_maybe_bind_and_lock(manager)) >> >> + worker_clr_flags(manager, WORKER_UNBOUND); >&g

Re: [PATCH 0/7 V6] workqueue: fix hoplug things

2012-09-08 Thread Lai Jiangshan
> > Hmmm... so, I'm having some difficulty communicating with you. We > need two separate patch series. One for for-3.6-fixes and the other > for restructuring on top of for-3.7 after the fixes are merged into > it. > > As you currently posted, the patches are based on for-3.7 and fixes > and res

Re: [PATCH 4/7 V6] workqueue: fix idle worker depletion

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 2:11 AM, Tejun Heo wrote: > On Sun, Sep 09, 2012 at 02:07:50AM +0800, Lai Jiangshan wrote: >> when we release gcwq->lock and then grab it, we leave a hole that things >> can be changed. >> >> I don't want to open a hole. if the hole has bu

Re: [PATCH 4/7 V6] workqueue: fix idle worker depletion

2012-09-08 Thread Lai Jiangshan
On Sun, Sep 9, 2012 at 3:02 AM, Tejun Heo wrote: > Hello, Lai. > > On Sun, Sep 09, 2012 at 02:34:02AM +0800, Lai Jiangshan wrote: >> in 3.6 busy_worker_rebind() handle WORKER_REBIND bit, >> not WORKER_UNBOUND bit. >> >> busy_worker_rebind() takes struct work_

[PATCH 1/2 V7 for-3.6-fixes] workqueue: add POOL_MANAGING_WORKERS

2012-09-09 Thread Lai Jiangshan
When hotplug happens, the plug code will also grab the manager_mutex, it will break too_many_workers()'s assumption, and make too_many_workers() ugly(kick the timer wrongly, no found bug). To avoid assumption-coruption, we add the original POOL_MANAGING_WORKERS back. Signed-off-by: Lai Jian

[PATCH 2/2 V7 for-3.6-fixes] workqueue: fix idle worker depletion

2012-09-09 Thread Lai Jiangshan
naly, if it fails, unbind itself. Signed-off-by: Lai Jiangshan --- kernel/workqueue.c | 31 ++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 383548e..74434c8 100644 --- a/kernel/workqueue.c +++ b/kernel/

[V4 PATCH 00/26] memory,numa: introduce MOVABLE-dedicated node and online_movable for hotplug

2012-09-10 Thread Lai Jiangshan
new V2 discards the MIGRATE_HOTREMOVE approach, and use a more straight implementation(only 1 patch). Lai Jiangshan (22): page_alloc.c: don't subtract unrelated memmap from zone's present pages memory_hotplug: fix missing nodemask management slub, hotplug: ignore unrelated node's

[V4 PATCH 01/26] page_alloc.c: don't subtract unrelated memmap from zone's present pages

2012-09-10 Thread Lai Jiangshan
So a new proper approach is needed to do it similarly and new approach should also handle other long living unreclaimable memory. Current blindly subtracted-present-pages-size approach does wrong, remove it. Signed-off-by: Lai Jiangshan --- mm/page_alloc.c | 20 +--- 1 files c

[V4 PATCH 04/26] node: cleanup node_state_attr

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

[V4 PATCH 23/26] memblock: limit memory address from memblock

2012-09-10 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 19dc455..f2977ae 100644 --- a

[V4 PATCH 20/26] page_alloc: add kernelcore_max_addr

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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 2b6b4a3..005f00c 100644 --- a/arch/x86/mm/init_64

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

[V4 PATCH 25/26] mm, memory-hotplug: add online_movable and online_kernel

2012-09-10 Thread Lai Jiangshan
ories, and helps for THP. Current constraints: Only the memoryblock which is adjacent to the ZONE_MOVABLE can be onlined from ZONE_NORMAL to ZONE_MOVABLE. For opposite onlining behavior, we also introduce "online_kernel" to change a memoryblock of ZONE_MOVABLE to ZONE_KERNEL when online.

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

2012-09-10 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 | 49 + 3 files changed, 48 insertions(+), 7 deletions

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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 fbf5efc..f726b5e 100644 --- a/mm/memblock.c +++ b/mm/memblock.c

[V4 PATCH 21/26] x86: get pg_data_t's memory from other node

2012-09-10 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 _

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

2012-09-10 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

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

2012-09-10 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

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

2012-09-10 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

[V4 PATCH 03/26] slub, hotplug: ignore unrelated node's hot-adding and hot-removing

2012-09-10 Thread Lai Jiangshan
SLUB only fucus on the nodes which has normal memory, so ignore the other node's hot-adding and hot-removing. so we only do something when marg->status_change_nid_normal > 0. Signed-off-by: Lai Jiangshan --- mm/slub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) d

[V4 PATCH 05/26] node_states: introduce N_MEMORY

2012-09-10 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(+

[V4 PATCH 02/26] memory_hotplug: fix missing nodemask management

2012-09-10 Thread Lai Jiangshan
hotplug. Also add @status_change_nid_normal to struct memory_notify, thus the memory hotplug callbacks know whether the node_states[N_NORMAL_MEMORY] are changed. Signed-off-by: Lai Jiangshan --- Documentation/memory-hotplug.txt |5 ++- include/linux/memory.h |1 + mm

[PATCH] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-08 Thread Lai Jiangshan
We only require cmpxchg()&retry when task is exiting. xchg() is enough in other cases like original code in ac3d0da8. So we try our best to use xchg() and avoid competition&latency from task_work_add(). Also remove the inner loop Signed-off-by: Lai Jiangshan --- diff --git a/kernel/tas

[PATCH 1/3] lglock: remove unused DEFINE_LGLOCK_LOCKDEP()

2012-10-08 Thread Lai Jiangshan
struct lglocks use their own lock_key/lock_dep_map which are defined in struct lglock. DEFINE_LGLOCK_LOCKDEP() is unused now, so we remove it and save a small piece of memory. Signed-off-by: Lai Jiangshan --- include/linux/lglock.h |9 - 1 files changed, 0 insertions(+), 9 deletions

[PATCH 2/3] lglock: make the per_cpu locks static

2012-10-08 Thread Lai Jiangshan
The per_cpu locks are not used outside nor exported. Add a "static" linkage keyword to it. Signed-off-by: Lai Jiangshan --- include/linux/lglock.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/linux/lglock.h b/include/linux/lglock.h index 45eff7

[PATCH 3/3] lglock: add DEFINE_STATIC_LGLOCK()

2012-10-08 Thread Lai Jiangshan
When if the lglock don't to be exported, we can use DEFINE_STATIC_LGLOCK(). Signed-off-by: Lai Jiangshan --- fs/file_table.c|2 +- include/linux/lglock.h |8 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index 70

[PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-09 Thread Lai Jiangshan
for task_work_run() and move the logic of exit_task_work() out from task_work_run(). Signed-off-by: Lai Jiangshan --- diff --git a/include/linux/task_work.h b/include/linux/task_work.h index ca5a1cf..1e686a5 100644 --- a/include/linux/task_work.h +++ b/include/linux/task_work.h @@ -15,10 +15,6 @@ ini

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

Re: [PATCH 0/8] workqueue: advance concurrency management

2013-04-18 Thread Lai Jiangshan
Ping. On Mon, Apr 15, 2013 at 12:41 AM, Lai Jiangshan wrote: > I found the early-increasing nr_running in wq_worker_waking_up() is useless > in many cases. it tries to avoid waking up idle workers for pending work item. > but delay increasing nr_running does not increase waking up idl

Re: [PATCH 0/8] workqueue: advance concurrency management

2013-04-20 Thread Lai Jiangshan
On Sat, Apr 20, 2013 at 2:11 AM, Tejun Heo wrote: > Hey, > > On Fri, Apr 19, 2013 at 06:10:57AM +0800, Lai Jiangshan wrote: >> Ping. > > Sorry, I've been at collab summit / lsf. Plus, it's a bit too late > for for-3.10 anyway. Anyways, after glancing over it,

Re: [PATCH 1/7] workqueue: add __WQ_FREEZING and remove POOL_FREEZING

2013-04-20 Thread Lai Jiangshan
Please forget all my other patches. But these 1/7 and 2/7 __WQ_FREEZING patches can be in 3.10 On Thu, Apr 4, 2013 at 10:12 PM, Tejun Heo wrote: > Hello, Lai. > > On Thu, Apr 04, 2013 at 10:05:32AM +0800, Lai Jiangshan wrote: >> @@ -4757,25 +4747,16 @@ void thaw_

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-12 Thread Lai Jiangshan
would remove the need for > the developer to predict which locks will be highly contended. > > This commit allows ticket locks to automatically switch between pure > ticketlock and queued-lock operation as needed. If too many CPUs are > spinning on a given ticket lock, a queue struc

Re: [PATCH RFC ticketlock] v3 Auto-queued ticketlock

2013-06-12 Thread Lai Jiangshan
ate code and update comments (Steven Rostedt). ] > [ paulmck: Address Eric Dumazet review feedback. ] > [ paulmck: Use Lai Jiangshan idea to eliminate smp_mb(). ] > [ paulmck: Expand ->head_tkt from s32 to s64 (Waiman Long). ] > [ paulmck: Move cpu_relax() to main spin loop (Steven

Re: [PATCH RFC ticketlock] v3 Auto-queued ticketlock

2013-06-12 Thread Lai Jiangshan
ode and update comments (Steven Rostedt). ] > [ paulmck: Address Eric Dumazet review feedback. ] > [ paulmck: Use Lai Jiangshan idea to eliminate smp_mb(). ] > [ paulmck: Expand ->head_tkt from s32 to s64 (Waiman Long). ] > [ paulmck: Move cpu_relax() to main spin loop (Steven

Re: [PATCH RFC ticketlock] v3 Auto-queued ticketlock

2013-06-13 Thread Lai Jiangshan
On Thu, Jun 13, 2013 at 11:22 PM, Paul E. McKenney wrote: > On Thu, Jun 13, 2013 at 10:55:41AM +0800, Lai Jiangshan wrote: >> On 06/12/2013 11:40 PM, Paul E. McKenney wrote: >> > Breaking up locks is better than implementing high-contention locks, but >> > if we must

Re: [PATCH RFC ticketlock] v3 Auto-queued ticketlock

2013-06-13 Thread Lai Jiangshan
On 06/14/2013 07:57 AM, Paul E. McKenney wrote: > On Fri, Jun 14, 2013 at 07:25:57AM +0800, Lai Jiangshan wrote: >> On Thu, Jun 13, 2013 at 11:22 PM, Paul E. McKenney >> wrote: >>> On Thu, Jun 13, 2013 at 10:55:41AM +0800, Lai Jiangshan wrote: >>>> On 06/12/2

Re: [PATCH RFC ticketlock] v3 Auto-queued ticketlock

2013-06-14 Thread Lai Jiangshan
On 06/14/2013 07:57 AM, Paul E. McKenney wrote: > On Fri, Jun 14, 2013 at 07:25:57AM +0800, Lai Jiangshan wrote: >> On Thu, Jun 13, 2013 at 11:22 PM, Paul E. McKenney >> wrote: >>> On Thu, Jun 13, 2013 at 10:55:41AM +0800, Lai Jiangshan wrote: >>>> On 06/12/2

[PATCH] clk: remove the clk_notifier from clk_notifier_list before free it (was: Re: [BUG] zynq | CCF | SRCU)

2013-06-03 Thread Lai Jiangshan
{ ret = -ENOENT; } clk_prepare_unlock(); return ret; } === Could you retry with the following patch? Thanks, Lai >From 5e26b626724139070148df9f6bd0607bc7bc3812 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 3 Jun 2013 16:59:50 +0

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-11 Thread Lai Jiangshan
On 06/11/2013 08:51 AM, Linus Torvalds wrote: > On Mon, Jun 10, 2013 at 5:44 PM, Steven Rostedt wrote: >> >> OK, I haven't found a issue here yet, but youss are beiing trickssy! We >> don't like trickssy, and we must find preiouss!!! > > .. and I personally have my usual reservations. I absol

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-11 Thread Lai Jiangshan
On Mon, Jun 10, 2013 at 3:36 AM, Paul E. McKenney wrote: > Breaking up locks is better than implementing high-contention locks, but > if we must have high-contention locks, why not make them automatically > switch between light-weight ticket locks at low contention and queued > locks at high conte

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-11 Thread Lai Jiangshan
On Tue, Jun 11, 2013 at 10:48 PM, Lai Jiangshan wrote: > On Mon, Jun 10, 2013 at 3:36 AM, Paul E. McKenney > wrote: >> Breaking up locks is better than implementing high-contention locks, but >> if we must have high-contention locks, why not make them automatically >> swi

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-11 Thread Lai Jiangshan
This commit allows ticket locks to automatically switch between pure > ticketlock and queued-lock operation as needed. If too many CPUs are > spinning on a given ticket lock, a queue structure will be allocated > and the lock will switch to queued-lock operation. When the lock becomes > f

Re: [PATCH RFC ticketlock] Auto-queued ticketlock

2013-06-12 Thread Lai Jiangshan
On Wed, Jun 12, 2013 at 9:58 AM, Steven Rostedt wrote: > On Wed, 2013-06-12 at 09:19 +0800, Lai Jiangshan wrote: > >> > + >> > +/* >> > + * Hand the lock off to the first CPU on the queue. >> > + */ >> > +void tkt_q_do_wake(arch_spinlock_t

Re: [PATCHSET wq/for-3.10] workqueue: NUMA affinity for unbound workqueues

2013-03-24 Thread Lai Jiangshan
Hi, TJ After long time(again) thought. I think this patchset has this problem: the work may be running on wrong CPU when there is online cpu in its wq's cpumask. example: node0(cpu0,cpu1),node1(cpu2,cpu3), wq's cpumask: 1,3 the pwq of this wq on the node1's cpumask: 3 current online cpu: 0-2. so

Re: workqueue, pci: INFO: possible recursive locking detected

2013-07-17 Thread Lai Jiangshan
On 07/16/2013 10:41 PM, Srivatsa S. Bhat wrote: > Hi, > > I have been seeing this warning every time during boot. I haven't > spent time digging through it though... Please let me know if > any machine-specific info is needed. > > Regards, > Srivatsa S. Bhat > > > --

Re: [PATCH RFC nohz_full 1/7] nohz_full: Add Kconfig parameter for scalable detection of all-idle state

2013-07-28 Thread Lai Jiangshan
On 07/27/2013 07:19 AM, Paul E. McKenney wrote: > From: "Paul E. McKenney" > > At least one CPU must keep the scheduling-clock tick running for > timekeeping purposes whenever there is a non-idle CPU. However, with > the new nohz_full adaptive-idle machinery, it is difficult to distinguish > bet

<    1   2   3   4   5   6   7   8   9   10   >