[PATCH 07/10] workqueue: simplify flush_workqueue_prep_cwqs()

2012-09-24 Thread Lai Jiangshan
and becomes a local variable This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 69 +++ 1 files changed, 26 insertions(+), 43 deletions(-) diff --git a/kernel/workqueue.c b/kernel

[PATCH 10/10] workqueue: remove wq-flush_color

2012-09-24 Thread Lai Jiangshan
Use wq-first_flusher-flush_color instead. If current task is the first_flusher, we use @flush_color or work_next_color(flush_color) directly. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 52

[PATCH 00/10] workqueue: restructure flush_workqueue() and start all flusher at the same time

2012-09-24 Thread Lai Jiangshan
The core patch is patch6, it makes all flusher can start and the same time and allow us do more cleanup. Only patch1 and patch6 change the behavior of the code. All other patches do not change any behavior. Lai Jiangshan (10): workqueue: always pass flush responsibility to next workqueue

[PATCH 08/10] workqueue: assign overflowed flushers's flush color when queued

2012-09-24 Thread Lai Jiangshan
is the work color of the WQ when flush_workqueue() starts. Remove an unneeded loop. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 19 +-- 1 files changed, 9 insertions(+), 10 deletions

[PATCH 09/10] workqueue: remove flusher_overflow

2012-09-24 Thread Lai Jiangshan
functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 39 +-- 1 files changed, 13 insertions(+), 26 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f687893..d78fe08 100644 --- a/kernel

[PATCH 04/10] workqueue: use nr_cwqs_to_flush array

2012-09-24 Thread Lai Jiangshan
Each color uses its own nr_cwqs_to_flush[color]. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 21 - 1 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kernel/workqueue.c b/kernel

[PATCH 01/10] workqueue: always pass flush responsibility to next

2012-09-24 Thread Lai Jiangshan
depriving the responsibility make the code complex, we pass it to the next unconditionally. After this change, we don't need to go back to repeat cascading, so we use break to exit the loop. The loop will be remove in later patch. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel

[PATCH 06/10] workqueue: start all flusher at the same time

2012-09-24 Thread Lai Jiangshan
) it saves a big loop(when we have many CPUs) and avoid to touch all gcwq again. Wake-up-and-cascade phase become simpler and return quickly. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 46 ++ 1 files changed, 18 insertions

[PATCH 03/10] workqueue: remove while(true)

2012-09-24 Thread Lai Jiangshan
The loop count is always=1, remove the while(true) and fix the indent. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 86 +--- 1 files changed, 41 insertions(+), 45

[PATCH 05/10] workqueue: add wq_dec_flusher_ref()

2012-09-24 Thread Lai Jiangshan
it is a helper to relase reference. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 22 +- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c

[PATCH 02/10] workqueue: remove unneeded check

2012-09-24 Thread Lai Jiangshan
. This patch doesn't make any functional difference. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 360b7e2..acd9e2f 100644 --- a/kernel/workqueue.c

Re: [PATCH 00/10] workqueue: restructure flush_workqueue() and start all flusher at the same time

2012-09-25 Thread Lai Jiangshan
On 09/25/2012 04:39 AM, Tejun Heo wrote: Hello, Lai. On Mon, Sep 24, 2012 at 06:07:02PM +0800, Lai Jiangshan wrote: The core patch is patch6, it makes all flusher can start and the same time and allow us do more cleanup. Only patch1 and patch6 change the behavior of the code. All other

Re: [PATCH 00/10] workqueue: restructure flush_workqueue() and start all flusher at the same time

2012-09-25 Thread Lai Jiangshan
On 09/25/2012 04:39 AM, Tejun Heo wrote: I do like the removal of explicit cascading and would have gone that direction if this code is just being implemented but I'm quite skeptical whether changing over to that now is justifiable. Flush bugs tend to be nasty and often difficult to track

Re: [PATCH 00/10] workqueue: restructure flush_workqueue() and start all flusher at the same time

2012-09-25 Thread Lai Jiangshan
On 09/26/2012 04:24 AM, Tejun Heo wrote: Hello, Lai. On Tue, Sep 25, 2012 at 05:02:43PM +0800, Lai Jiangshan wrote: It is not possible to remove cascading. If cascading code is not in flush_workqueue(), it must be in some where else. Yeah, sure, I liked that it didn't have to be done

[PATCH 00/12] workqueue: simple cleanups

2012-09-26 Thread Lai Jiangshan
these all are different cleanups for workqueue. depends: Patch2 depends on Patch1 Patch3 depends on Patch1 Patch7 depends on Patch6 Patch7 need to be merged after Patch3 is merged.(not really depends) Lai Jiangshan (12): workqueue: add WORKER_RESCUER workqueue: disallow set_cpus_allowed_ptr

[PATCH 05/12] workqueue: don't wake up other workers in rescuer

2012-09-26 Thread Lai Jiangshan
rescuer is NOT_RUNNING, so there is no sense when it wakes up other workers, if there are available normal workers, they are already woken up when needed. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |8 1 files changed, 0 insertions(+), 8 deletions

[RFC PATCH 11/12] workqueue: add WQ_CPU_INTENSIVE to system_long_wq

2012-09-26 Thread Lai Jiangshan
-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 89fd1b2..ccb1d60 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -3850,7 +3850,7 @@ static int __init

[PATCH 06/12] workqueue: destroy_worker() can only destory idle worker not just created worker

2012-09-26 Thread Lai Jiangshan
-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6c339bf..fe3b1d3 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1756,8 +1756,7 @@ static

[PATCH 10/12] cpu-hotplug.txt: fix comments of work_on_cpu()

2012-09-26 Thread Lai Jiangshan
This is a tiny fix of the comments of work_on_cpu() which is changed back to use workqueue and it can be run at some time. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- Documentation/cpu-hotplug.txt |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Documentation

[PATCH 03/12] workqueue: remove WORKER_PREP from rescuer

2012-09-26 Thread Lai Jiangshan
There is no reason to use WORKER_PREP, remove it from rescuer. And there is no reason to set it so early in alloc_worker(), move worker-flags = WORKER_PREP to start_worker(). Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |3 +-- 1 files changed, 1 insertions(+), 2

[PATCH 12/12] workqueue: avoid work_on_cpu() to interfere system_wq

2012-09-26 Thread Lai Jiangshan
We can't expect how long the work of work_on_cpu() will run. So move it to system_long_wq to avoid it interfere system_wq. Note: The initial implement(2d3854a3) of work_on_cpu() uses its own workqueue. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |2 +- 1 files

[PATCH 09/12] workqueue: declare system_highpri_wq

2012-09-26 Thread Lai Jiangshan
system_highpri_wq is missed in workqueue.h, add it back. also add a short comment for it. CC: Joonsoo Kim js1...@gmail.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- include/linux/workqueue.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux

[PATCH 08/12] workqueue: fix comments of insert_work()

2012-09-26 Thread Lai Jiangshan
This comment is so important to understand the CMWQ, fix it and make new reviewer who read workqueue.c at the first time. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/workqueue.c b/kernel

[PATCH 07/12] workqueue: remove WORKER_STARTED

2012-09-26 Thread Lai Jiangshan
All newly created worker will enter idle soon, WORKER_STARTED is not used any more, remove it. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index fe3b1d3

[PATCH 01/12] workqueue: add WORKER_RESCUER

2012-09-26 Thread Lai Jiangshan
on rescuer thread, but this kind of implement is ugly: A) It reuses WORKER_PREP which is used for a different meaning. B) It does not told us rescuer thread is WORKER_NOT_RUNNING. So we add WORKER_RESCUER to fix these two sematic. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel

[PATCH 04/12] workqueue: simplify is_chained_work()

2012-09-26 Thread Lai Jiangshan
is_chained_work() is too complicated. we can simply found out whether current task is worker by PF_WQ_WORKER or wq-rescuer. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 36 1 files changed, 12 insertions(+), 24 deletions

[PATCH 02/12] workqueue: disallow set_cpus_allowed_ptr() from work item

2012-09-26 Thread Lai Jiangshan
no PF_WQ_WORKER, skip this behavior) It prevents other/future BUGs like https://bugzilla.kernel.org/show_bug.cgi?id=47301. CC: tangchen tangc...@cn.fujitsu.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/sched/core.c |8 +--- kernel/workqueue.c | 10 +- 2 files

[PATCH 0/3] memory_hotplug: fix memory hotplug bug

2012-09-27 Thread Lai Jiangshan
...@kvack.org Lai Jiangshan (3): memory_hotplug: fix missing nodemask management slub, hotplug: ignore unrelated node's hot-adding and hot-removing memory,hotplug: Don't modify the zone_start_pfn outside of zone_span_writelock() Documentation/memory-hotplug.txt |5 ++- include/linux

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

2012-09-27 Thread Lai Jiangshan
-off-by: Lai Jiangshan la...@cn.fujitsu.com --- mm/slub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2fdd96f..2d78639 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3577,7 +3577,7 @@ static void slab_mem_offline_callback(void *arg

[PATCH 3/3] memory_hotplug: Don't modify the zone_start_pfn outside of zone_span_writelock()

2012-09-27 Thread Lai Jiangshan
or in booting. Since zone_start_pfn is not modified by init_currently_empty_zone() grow_zone_span() needs to check zone_start_pfn before update it. CC: Mel Gorman m...@csn.ul.ie Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com Reported-by: Yasuaki ISIMATU isimatu.yasu...@jp.fujitsu.com Tested

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

2012-09-27 Thread Lai Jiangshan
] and node_states[N_NORMAL_MEMORY] are changed while hotpluging. 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 la...@cn.fujitsu.com --- Documentation/memory

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

2012-09-28 Thread Lai Jiangshan
On 09/27/2012 10:32 PM, Ni zhan Chen wrote: On 09/27/2012 02:47 PM, 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] becomes stale. We add

Re: [PATCH 3/3] memory_hotplug: Don't modify the zone_start_pfn outside of zone_span_writelock()

2012-09-28 Thread Lai Jiangshan
Hi, KOSAKI On 09/28/2012 06:30 AM, KOSAKI Motohiro wrote: (9/27/12 2:47 AM), Lai Jiangshan wrote: The __add_zone() maybe call sleep-able init_currently_empty_zone() to init wait_table, This doesn't explain why sleepable is critical important. I think sleepable is jsut unrelated. The fact

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

2012-09-28 Thread Lai Jiangshan
is not suitable here. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- mm/slub.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 2fdd96f..2d78639 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3577,7 +3577,7 @@ static void

Re: [PATCH 3/3] memory_hotplug: Don't modify the zone_start_pfn outside of zone_span_writelock()

2012-09-28 Thread Lai Jiangshan
Hi, Chen, On 09/27/2012 09:19 PM, Ni zhan Chen wrote: On 09/27/2012 02:47 PM, Lai Jiangshan wrote: The __add_zone() maybe call sleep-able init_currently_empty_zone() to init wait_table, But this function also modifies the zone_start_pfn without any lock. It is bugy. So we move

Re: [PATCH] Do not change worker's running cpu in cmci_rediscover().

2012-09-28 Thread Lai Jiangshan
Add CC: Tejun Heo, Peter Zijlstra. Hi, Tejun This is a bug whose root cause is the same as https://bugzilla.kernel.org/show_bug.cgi?id=47301. Acked-by: Lai Jiangshan la...@cn.fujitsu.com thanks, Lai On 09/27/2012 05:19 PM, Tang Chen wrote: 1. cmci_rediscover() is only called

[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 competitionlatency from task_work_add(). Also remove the inner loop Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- diff --git

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 la...@cn.fujitsu.com wrote: HI, Christoph, KOSAKI SLAB always allocates kmem_list3 for all nodes(N_HIGH_MEMORY), also node bug/bad things happens. SLUB always requires kmem_cache_node

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

2012-10-24 Thread Lai Jiangshan
-foundation.org CC: Jiang Liu jiang@huawei.com CC: Kay Sievers kay.siev...@vrfy.org CC: Greg Kroah-Hartman gre...@suse.de CC: Mel Gorman mgor...@suse.de CC: 'FNST-Wen Congyang' we...@cn.fujitsu.com CC: linux-...@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux...@kvack.org Signed-off-by: Lai

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

2012-10-24 Thread Lai Jiangshan
: Mel Gorman mgor...@suse.de CC: 'FNST-Wen Congyang' we...@cn.fujitsu.com CC: linux-...@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux...@kvack.org Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- Documentation/memory-hotplug.txt |5 +- include/linux/memory.h |1

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

2012-10-24 Thread Lai Jiangshan
jiang@huawei.com CC: Kay Sievers kay.siev...@vrfy.org CC: Greg Kroah-Hartman gre...@suse.de CC: Mel Gorman mgor...@suse.de CC: 'FNST-Wen Congyang' we...@cn.fujitsu.com CC: linux-...@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux...@kvack.org Lai Jiangshan (2): memory_hotplug: fix

[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 la...@cn.fujitsu.com --- include/linux/lglock.h |9 - 1 files changed, 0

[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 la...@cn.fujitsu.com --- 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

[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 la...@cn.fujitsu.com --- 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

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

2012-10-09 Thread Lai Jiangshan
task_work_run(). Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- 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 @@ init_task_work(struct callback_head *twork

[PATCH 4/4] rcutorture: use DEFINE_STATIC_SRCU()

2012-10-12 Thread Lai Jiangshan
use DEFINE_STATIC_SRCU() to simplify the rcutorture.c Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/rcutorture.c | 41 ++--- 1 files changed, 6 insertions(+), 35 deletions(-) diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c index

[PATCH 1/4] srcu: add my name

2012-10-12 Thread Lai Jiangshan
I changed a lot for srcu, add my name here, thus any one can blame/contact to me when needed. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- include/linux/srcu.h |2 ++ kernel/srcu.c|2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/linux/srcu.h

[PATCH 3/4] srcu: add DEFINE_SRCU()

2012-10-12 Thread Lai Jiangshan
a single *.c. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- include/linux/srcu.h | 30 ++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 5cce128..f986df1 100644 --- a/include/linux/srcu.h +++ b

[PATCH 2/4] srcu: export process_srcu()

2012-10-12 Thread Lai Jiangshan
process_srcu() will be used in DEFINE_SRCU() (only). Although it is exported, it is still an internal in srcu.h. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- include/linux/srcu.h |2 ++ kernel/srcu.c|6 ++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH 0/4] srcu: Add DEFINE_SRCU()

2012-10-12 Thread Lai Jiangshan
These patches add a simple DEFINE_SRCU() which define and init the srcu struct in build time, and allow us use srcu in very early boot time. Lai Jiangshan (4): srcu: add my name srcu: export process_srcu() srcu: add DEFINE_SRCU rcutorture: use DEFINE_STATIC_SRCU() include/linux/srcu.h

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] becomes stale. What's mean

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 la...@cn.fujitsu.com 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_MEMORY] becomes

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

2012-10-26 Thread Lai Jiangshan
purpose/reason. This adjustment is incorrect/buggy, subtracts unrelated value and violates its original purpose, so we simply remove the adjustment. CC: Mel Gorman mgor...@suse.de Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- mm/page_alloc.c | 20 +--- 1 files changed, 1

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

2012-10-29 Thread Lai Jiangshan
://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 portion memory memory_hotplug: handle empty zone when online_movable/online_kernel

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

2012-10-29 Thread Lai Jiangshan
. When it is online by online_kernel, the kernel can use it. When it is online by online, the zone type doesn't changed. Current constraints: Only the memoryblock which is adjacent to the ZONE_MOVABLE can be online from ZONE_NORMAL to ZONE_MOVABLE. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com

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

2012-10-29 Thread Lai Jiangshan
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 la...@cn.fujitsu.com --- mm/memory_hotplug.c | 40 1 files changed, 40 insertions(+), 0 deletions(-) diff

[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 la...@cn.fujitsu.com Acked-by: Hillf Danton dhi

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

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

[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 la...@cn.fujitsu.com --- drivers/base/node.c | 20 ++-- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/base

[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 la...@cn.fujitsu.com Acked-by: Christoph Lameter c

[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 la...@cn.fujitsu.com --- 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

[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 la...@cn.fujitsu.com --- mm/memcontrol.c | 18

[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 la...@cn.fujitsu.com --- drivers/base/node.c |6 ++ include/linux/nodemask.h |4 mm/Kconfig |8

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

2012-10-29 Thread Lai Jiangshan
. Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- 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

[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 la...@cn.fujitsu.com --- Documentation/memory-hotplug.txt |5 ++- include/linux/memory.h |1 + mm/memory_hotplug.c | 87 +++--- 3 files changed, 77 insertions

[V5 PATCH 05/26] node_states: introduce N_MEMORY

2012-10-29 Thread Lai Jiangshan
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 la...@cn.fujitsu.com Acked-by: Christoph Lameter c...@linux.com Acked-by: Hillf Danton dhi...@gmail.com --- include/linux/nodemask.h |1 + 1 files

[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 la...@cn.fujitsu.com Acked-by: Hillf Danton dhi

[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 la...@cn.fujitsu.com Acked-by: Hillf Danton dhi

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

2012-10-29 Thread Lai Jiangshan
From: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com memblock.current_limit is set directly though memblock_set_current_limit() is prepared. So fix it. Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- arch/x86/kernel/setup.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 la...@cn.fujitsu.com --- kernel/kthread.c |2

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

2012-10-29 Thread Lai Jiangshan
. The patch adds the check to memblock_find_in_range_node() Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- mm/memblock.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index

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

2012-10-29 Thread Lai Jiangshan
(). Signed-off-by: Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- 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

[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 la...@cn.fujitsu.com Acked-by: Christoph Lameter c

[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 la...@cn.fujitsu.com Reported-by: Wen Congyang we...@cn.fujitsu.com --- mm/mempolicy.c | 36

[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 la...@cn.fujitsu.com --- init/main.c |2 +- 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 la...@cn.fujitsu.com Acked-by: Hillf Danton dhi

[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 la...@cn.fujitsu.com --- mm/memory_hotplug.c | 51 +-- 1 files changed, 45 insertions(+), 6 deletions(-) diff --git a/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 la...@cn.fujitsu.com Acked-by: Hillf Danton dhi

[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 la...@cn.fujitsu.com --- mm/mempolicy.c | 12

[V5 PATCH 21/26] page_alloc: add kernelcore_max_addr

2012-10-29 Thread Lai Jiangshan
). Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- 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

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

2012-10-16 Thread Lai Jiangshan
On 10/17/2012 10:23 AM, Linus Torvalds wrote: [ Architecture people, note the potential new SMP barrier! ] On Tue, Oct 16, 2012 at 4:30 PM, Mikulas Patocka mpato...@redhat.com wrote: + /* +* The lock is considered unlocked when p-locked is set to false. +* Use barrier

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 accesses don't

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 la...@cn.fujitsu.com 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

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 t...@kernel.org 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, here are my preliminary

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 t...@kernel.org wrote: Hello, Lai. On Thu, Apr 04, 2013 at 10:05:32AM +0800, Lai Jiangshan wrote: @@ -4757,25 +4747,16 @@ void thaw_workqueues(void

[PATCH 3/7] workqueue: rename rebind_workers() to associate_cpu_pool()

2013-04-03 Thread Lai Jiangshan
merge the code of clearing POOL_DISASSOCIATED to rebind_workers(), and rename rebind_workers() to associate_cpu_pool(). It merges high related code together and simplify workqueue_cpu_up_callback(). Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 21

[PATCH 2/7] workqueue: set __WQ_FREEZING only when freezable

2013-04-03 Thread Lai Jiangshan
simplify pwq_adjust_max_active(). make freeze_workqueues_begin() and thaw_workqueues() fast skip non-freezable wq. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/kernel/workqueue.c b

[PATCH 4/7] workqueue: simplify workqueue_cpu_up_callback(CPU_ONLINE)

2013-04-03 Thread Lai Jiangshan
If we have 4096 CPUs, workqueue_cpu_up_callback() will travel too much CPUs, to avoid it, we use for_each_cpu_worker_pool() for the cpu pools and use for_each_unbound_pool() for unbound pools. After it, for_each_pool() becomes unused, but we keep it for future possible usage. Signed-off-by: Lai

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

2013-04-03 Thread Lai Jiangshan
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 remove POOL_FREEZING. Signed-off-by: Lai

[PATCH 7/7] workqueue: avoid false negative WARN_ON()

2013-04-03 Thread Lai Jiangshan
+0x1e/0x20 [8.025678] [c085ba4d] sysenter_do_call+0x12/0x38 Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 3f33077..f015c38 100644 --- a/kernel

[PATCH 6/7] workqueue: node-awared allocation for unbound pool

2013-04-03 Thread Lai Jiangshan
calculate the node of the pool earlier, and allocate the pool from the node. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 29 +++-- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c

[PATCH 5/7] workqueue, use default pwq when fail to allocate node pwd

2013-04-03 Thread Lai Jiangshan
When we fail to allocate the node pwq, we can use the default pwq for the node. Thus we can avoid failure after allocated default pwq, and remove some code for failure path. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com --- kernel/workqueue.c | 28 +++- 1 files

Re: Word-at-a-time dcache name accesses (was Re: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?)

2013-04-04 Thread Lai Jiangshan
[resend in plain text mode (I did not notice the gmail changed the default mode, sorry)] On Fri, Apr 5, 2013 at 12:17 AM, Lai Jiangshan la...@cn.fujitsu.com wrote: Hi, ALL I also encountered the same problem. git bisect: 14134f6584212d585b310ce95428014b653dfaf6 is the first bad commit

Re: [PATCH 1/3] kernel/srcu: merge common code into a macro

2013-04-05 Thread Lai Jiangshan
On 03/19/2013 10:16 PM, Sebastian Andrzej Siewior wrote: DEFINE_SRCU() and DEFINE_STATIC_SRCU() does the same thing except for the static attribute. This patch moves the common pieces into _DEFINE_SRCU() which is used by the the former macros either adding the static attribute or not.

Re: [PATCH 2/3] kernel/SRCU: provide a static initializer

2013-04-05 Thread Lai Jiangshan
On 03/19/2013 10:16 PM, Sebastian Andrzej Siewior wrote: There are macros for static initializer for the three out of four possible notifier types, that are: ATOMIC_NOTIFIER_HEAD() BLOCKING_NOTIFIER_HEAD() RAW_NOTIFIER_HEAD() This patch provides a static initilizer for

Re: [PATCH 7/9] fsnotify: use existed call_srcu()

2013-04-05 Thread Lai Jiangshan
[Ping] Hi, Eric Paris Could you review this patch? Thanks, Lai On 03/16/2013 12:50 AM, Lai Jiangshan wrote: fsnotify implements its own call_srcu() by: dedicated thread + synchronize_srcu() But srcu provides call_srcu() now, so we should convert them to use existed call_srcu

Re: [PATCH] workqueue: avoid false negative WARN_ON() in destroy_workqueue()

2013-04-05 Thread Lai Jiangshan
On 04/04/2013 10:55 PM, Tejun Heo wrote: From 5c529597e922c26910fe49b8d5f93aeaca9a2415 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan la...@cn.fujitsu.com Date: Thu, 4 Apr 2013 10:05:38 +0800 destroy_workqueue() performs several sanity checks before proceeding with destruction of a workqueue

Re: af_unix udev startup regression

2013-04-07 Thread Lai Jiangshan
test-cases obviously have to be fixed, and the commit that causes the problem needs to be reverted. Test-cases count for nothing compared to actual users. Linus On Thu, Apr 4, 2013 at 9:17 AM, Lai Jiangshan la...@cn.fujitsu.com wrote: Hi, ALL I also encountered the same

Re: [PATCH 2/3] kernel/SRCU: provide a static initializer

2013-04-08 Thread Lai Jiangshan
On 04/08/2013 06:03 PM, Sebastian Andrzej Siewior wrote: On 04/05/2013 09:21 AM, Lai Jiangshan wrote: Hi, Sebastian Hi Lai, I don't want to expose __SRCU_STRUCT_INIT(), due to it has strong coupling with the percpu array. I hope other structure which uses SRCU should use

Re: [PATCH 2/3] kernel/SRCU: provide a static initializer

2013-04-11 Thread Lai Jiangshan
On 04/12/2013 01:04 AM, Sebastian Andrzej Siewior wrote: * Lai Jiangshan | 2013-04-09 09:09:56 [+0800]: If the percpu array can be defined in __SRCU_STRUCT_INIT(), I'm happy to expose it. but it is not currently. I have no idea how to achieve this. Why crypto can't use boot time

  1   2   3   4   5   6   7   8   9   10   >