[PATCH v2 3/3] slub: add 'likely' macro to inc_slabs_node()

2013-01-21 Thread Joonsoo Kim
After boot phase, 'n' always exist. So add 'likely' macro for helping compiler. Acked-by: Christoph Lameter c...@linux.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/mm/slub.c b/mm/slub.c index 8b95364..ddbd401 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1005,7 +1005,7

[PATCH v2 1/3] slub: correct to calculate num of acquired objects in get_partial_node()

2013-01-21 Thread Joonsoo Kim
is always false and we always go to second iteration. This patch correct this problem. After that, we don't need return value of put_cpu_partial(). So remove it. v2: calculate nr of objects using new.objects and new.inuse. It is more accurate way than before. Signed-off-by: Joonsoo Kim iamjoonsoo

Re: [RFC][PATCH v2] slub: Keep page and object in sync in slab_alloc_node()

2013-01-21 Thread Joonsoo Kim
On Fri, Jan 18, 2013 at 10:55:01AM -0500, Steven Rostedt wrote: On Fri, 2013-01-18 at 10:04 -0500, Steven Rostedt wrote: Just to be more complete: CPU0CPU1 c = __this_cpu_ptr(s-cpu_slab);

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

2013-01-21 Thread Joonsoo Kim
Hello, Tejun. On Wed, Jan 16, 2013 at 05:42:32PM -0800, Tejun Heo wrote: Hello, Currently, on the backend side, there are two layers of abstraction. For each CPU and the special unbound wq-specific CPU, there's one global_cwq. gcwq in turn hosts two worker_pools - one for normal priority,

Re: [PATCH 15/17] workqueue: remove global_cwq

2013-01-21 Thread Joonsoo Kim
On Wed, Jan 16, 2013 at 05:42:47PM -0800, Tejun Heo wrote: global_cwq is now nothing but a container for per-pcu standard s/per-pcu/per-cpu/ worker_pools. Declare the worker pools directly as cpu/unbound_std_worker_pools[] and remove global_cwq. * get_gcwq() is replaced with

[PATCH v3 0/3] introduce static_vm for ARM-specific static mapped area

2013-01-23 Thread Joonsoo Kim
: coverletter: refer a link related to this work [2/3]: drop @flags of find_static_vm_vaddr Rebased on v3.8-rc4 v1-v2: [2/3]: patch description is improved. Rebased on v3.7-rc7 Joonsoo Kim (3): ARM: vmregion: remove vmregion code entirely ARM: static_vm: introduce an infrastructure for static

[PATCH v3 1/3] ARM: vmregion: remove vmregion code entirely

2013-01-23 Thread Joonsoo Kim
From: Joonsoo Kim js1...@gmail.com Now, there is no user for vmregion. So remove it. Signed-off-by: Joonsoo Kim js1...@gmail.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index 8a9c4cb..4e333fa 100644 --- a/arch/arm/mm/Makefile

[PATCH v3 2/3] ARM: static_vm: introduce an infrastructure for static mapped area

2013-01-23 Thread Joonsoo Kim
From: Joonsoo Kim js1...@gmail.com In current implementation, we used ARM-specific flag, that is, VM_ARM_STATIC_MAPPING, for distinguishing ARM specific static mapped area. The purpose of static mapped area is to re-use static mapped area when entire physical address range of the ioremap request

[PATCH v3 3/3] ARM: mm: use static_vm for managing static mapped areas

2013-01-23 Thread Joonsoo Kim
From: Joonsoo Kim js1...@gmail.com A static mapped area is ARM-specific, so it is better not to use generic vmalloc data structure, that is, vmlist and vmlist_lock for managing static mapped area. And it causes some needless overhead and reducing this overhead is better idea. Now, we have newly

Re: [PATCH v2 15/17] workqueue: remove global_cwq

2013-01-24 Thread Joonsoo Kim
worker_pool rather than the array so that every pool is aligned. Signed-off-by: Tejun Heo t...@kernel.org Cc: Joonsoo Kim js1...@gmail.com --- Rebased on top of the current wq/for-3.9 and Joonsoo's comments applied. Thanks. kernel/workqueue.c | 46

[PATCH 2/3] staging, zcache: use zs_mem_[read/write]

2013-01-16 Thread Joonsoo Kim
Now, we have newly introduced APIs which reduce copy overhead of zsmalloc for objects on page boundary. So use it in zcache. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index 52b43b7..d1dee76 100644

[RFC PATCH 1/3] staging, zsmalloc: introduce zs_mem_[read/write]

2013-01-16 Thread Joonsoo Kim
. Using this information, we can do memcpy without overhead. For USE_PGTABLE_MAPPING case, we can avoid flush cache and tlb overhead via these API. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com --- These are [RFC] patches, because I don't test and I don't have test environment, yet. Just compile

[PATCH 3/3] staging, zram: use zs_mem_[read/write]

2013-01-16 Thread Joonsoo Kim
Now, we have newly introduced APIs which reduce copy overhead of zsmalloc for objects on page boundary. So use it in zram. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index fb4a7c9..554a742 100644 --- a/drivers

Re: [PATCH 1/3] slub: correct to calculate num of acquired objects in get_partial_node()

2013-01-16 Thread Joonsoo Kim
On Tue, Jan 15, 2013 at 03:46:17PM +, Christoph Lameter wrote: On Tue, 15 Jan 2013, Joonsoo Kim wrote: There is a subtle bug when calculating a number of acquired objects. After acquire_slab() is executed at first, page-inuse is same as page-objects, then, available is always 0. So

Re: [PATCH 2/3] slub: correct bootstrap() for kmem_cache, kmem_cache_node

2013-01-16 Thread Joonsoo Kim
On Tue, Jan 15, 2013 at 03:36:10PM +, Christoph Lameter wrote: On Tue, 15 Jan 2013, Joonsoo Kim wrote: These didn't make any error previously, because we normally don't free objects which comes from kmem_cache's first slab and kmem_cache_node's. And these slabs are on the partial

Re: [PATCH V2] mm/slab: add a leak decoder callback

2013-01-17 Thread Joonsoo Kim
Hello, Liu Bo. On Wed, Jan 16, 2013 at 11:03:13AM +0800, Liu Bo wrote: This adds a leak decoder callback so that slab destruction can use to generate debugging output for the allocated objects. Callers like btrfs are using their own leak tracking which will manage allocated objects in a

Re: [RFC][PATCH v2] slub: Keep page and object in sync in slab_alloc_node()

2013-01-17 Thread Joonsoo Kim
that, it's fine to allow preemption. How about this? It's based on v3.8-rc3. I'm not test this patch, yet. Just for sharing my idea to fix a problem. -8--- From aaf529e347b7deb8c35dd484abc9166a5d3c0629 Mon Sep 17 00:00:00 2001 From: Joonsoo Kim iamjoonsoo

[PATCH 6/8] sched: rename load_balance_tmpmask to load_balance_cpu_active

2013-02-13 Thread Joonsoo Kim
This name doesn't represent specific meaning. So rename it to imply it's purpose. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 26058d0..e6f8783 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6814,7 +6814,7

[PATCH 1/8] sched: change position of resched_cpu() in load_balance()

2013-02-13 Thread Joonsoo Kim
cur_ld_moved is reset if env.flags hit LBF_NEED_BREAK. So, there is possibility that we miss doing resched_cpu(). Correct it as changing position of resched_cpu() before checking LBF_NEED_BREAK. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/fair.c b/kernel/sched

[PATCH 8/8] sched: reset lb_env when redo in load_balance()

2013-02-13 Thread Joonsoo Kim
...@linux.vnet.ibm.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 70631e8..25c798c 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5014,14 +5014,20 @@ static int load_balance(int this_cpu, struct rq *this_rq, struct lb_env env

[PATCH 7/8] sched: prevent to re-select dst-cpu in load_balance()

2013-02-13 Thread Joonsoo Kim
Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/core.c b/kernel/sched/core.c index e6f8783..d4c6ed0 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6814,6 +6814,7 @@ struct task_group root_task_group; LIST_HEAD

[PATCH 5/8] sched: move up affinity check to mitigate useless redoing overhead

2013-02-13 Thread Joonsoo Kim
to other cpus and, of course, this situaltion may be continued after we change the target cpu. So this patch clear LBF_ALL_PINNED in order to mitigate useless redoing overhead, if can_migrate_task() is failed by above reason. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched

[PATCH 4/8] sched: clean up move_task() and move_one_task()

2013-02-13 Thread Joonsoo Kim
Some validation for task moving is performed in move_tasks() and move_one_task(). We can move these code to can_migrate_task() which is already exist for this purpose. Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 97498f4..849bc8e

[PATCH 0/8] correct load_balance()

2013-02-13 Thread Joonsoo Kim
be moved as cpu affinity. But, currently, if imbalance is not large enough to task's load, we leave LBF_ALL_PINNED flag and 'redo' is triggered. This is not our intention, so correct it. These are based on v3.8-rc7. Joonsoo Kim (8): sched: change position of resched_cpu() in load_balance

[PATCH 3/8] sched: don't consider other cpus in our group in case of NEWLY_IDLE

2013-02-13 Thread Joonsoo Kim
...@linux.vnet.ibm.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0c6aaf6..97498f4 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5016,8 +5016,15 @@ static int load_balance(int this_cpu, struct rq *this_rq

[PATCH 2/8] sched: explicitly cpu_idle_type checking in rebalance_domains()

2013-02-13 Thread Joonsoo Kim
After commit 88b8dac0, dst-cpu can be changed in load_balance(), then we can't know cpu_idle_type of dst-cpu when load_balance() return positive. So, add explicit cpu_idle_type checking. Cc: Srivatsa Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Joonsoo Kim iamjoonsoo@lge.com diff --git

Re: [RFC] sched: The removal of idle_balance()

2013-02-14 Thread Joonsoo Kim
Hello, Steven. On Fri, Feb 15, 2013 at 01:13:39AM -0500, Steven Rostedt wrote: Performance counter stats for '/work/c/hackbench 500' (100 runs): 199820.045583 task-clock#8.016 CPUs utilized ( +- 5.29% ) [100.00%] 3,594,264 context-switches

Re: [patch v5 01/15] sched: set initial value for runnable avg of sched entities.

2013-02-18 Thread Joonsoo Kim
Hello, Alex. On Mon, Feb 18, 2013 at 01:07:28PM +0800, Alex Shi wrote: We need initialize the se.avg.{decay_count, load_avg_contrib} to zero after a new task forked. Otherwise random values of above variables cause mess when do new task I think that these are not random values. In

Re: [patch v5 10/15] sched: packing transitory tasks in wake/exec power balancing

2013-02-18 Thread Joonsoo Kim
Hello, Alex. On Mon, Feb 18, 2013 at 01:07:37PM +0800, Alex Shi wrote: If the waked/execed task is transitory enough, it will has a chance to be packed into a cpu which is busy but still has time to care it. For powersaving policy, only the history util 25% task has chance to be packed, and

Re: [PATCHv5 1/8] zsmalloc: add to mm/

2013-02-19 Thread Joonsoo Kim
Hello, Seth. I'm not sure that this is right time to review, because I already have seen many effort of various people to promote zxxx series. I don't want to be a stopper to promote these. :) But, I read the code, now, and then some comments below. On Wed, Feb 13, 2013 at 12:38:44PM -0600, Seth

Re: [PATCHv5 1/8] zsmalloc: add to mm/

2013-02-22 Thread Joonsoo Kim
On Wed, Feb 20, 2013 at 08:37:33AM +0900, Minchan Kim wrote: On Tue, Feb 19, 2013 at 11:54:21AM -0600, Seth Jennings wrote: On 02/19/2013 03:18 AM, Joonsoo Kim wrote: Hello, Seth. I'm not sure that this is right time to review, because I already have seen many effort of various people

Re: [PATCHv6 1/8] zsmalloc: add to mm/

2013-02-22 Thread Joonsoo Kim
On Wed, Feb 20, 2013 at 04:04:41PM -0600, Seth Jennings wrote: = DO NOT MERGE, FOR REVIEW ONLY This patch introduces zsmalloc as new code, however, it already exists in drivers/staging. In order to build successfully, you must select EITHER to driver/staging version OR this version.

Re: [PATCH v2] slub: correctly bootstrap boot caches

2013-02-22 Thread JoonSoo Kim
2013/2/23 Christoph Lameter c...@linux.com: On Fri, 22 Feb 2013, Glauber Costa wrote: On 02/22/2013 09:01 PM, Christoph Lameter wrote: Argh. This one was the final version: https://patchwork.kernel.org/patch/2009521/ It seems it would work. It is all the same to me. Which one do you

Re: [PATCHv6 4/8] zswap: add to mm/

2013-02-24 Thread Joonsoo Kim
Hello, Seth. Here comes minor comments. On Wed, Feb 20, 2013 at 04:04:44PM -0600, Seth Jennings wrote: zswap is a thin compression backend for frontswap. It receives pages from frontswap and attempts to store them in a compressed memory pool, resulting in an effective partial memory reclaim

Re: [PATCH 0/8] correct load_balance()

2013-02-24 Thread Joonsoo Kim
On Thu, Feb 14, 2013 at 02:48:33PM +0900, Joonsoo Kim wrote: Commit 88b8dac0 makes load_balance() consider other cpus in its group. But, there are some missing parts for this feature to work properly. This patchset correct these things and make load_balance() robust. Others are related

Re: [PATCH v2] slub: correctly bootstrap boot caches

2013-02-24 Thread Joonsoo Kim
Hello, Christoph. On Sun, Feb 24, 2013 at 12:35:22AM +, Christoph Lameter wrote: On Sat, 23 Feb 2013, JoonSoo Kim wrote: With flushing, deactivate_slab() occur and it has some overhead to deactivate objects. If my patch properly fix this situation, it is better to use mine which

Re: [PATCH 1/4] slab: do ClearSlabPfmemalloc() for all pages of slab

2012-09-06 Thread JoonSoo Kim
it is possible that that __ac_put_obj() checks SlabPfmemalloc on a tail page and while this is harmless, it is sloppy. This patch ensures that the head page is always used. This problem was originally identified by Joonsoo Kim. [js1...@gmail.com: Original implementation and problem

Re: [PATCH 1/4] slab: do ClearSlabPfmemalloc() for all pages of slab

2012-09-06 Thread JoonSoo Kim
as it is expected that order-0 pages are in use. Unfortunately it is possible that that __ac_put_obj() checks SlabPfmemalloc on a tail page and while this is harmless, it is sloppy. This patch ensures that the head page is always used. This problem was originally identified by Joonsoo Kim. [js1...@gmail.com

Re: [PATCH 2/2] slub: remove one code path and reduce lock contention in __slab_free()

2012-09-06 Thread JoonSoo Kim
2012/8/25 JoonSoo Kim js1...@gmail.com: 2012/8/16 Joonsoo Kim js1...@gmail.com: When we try to free object, there is some of case that we need to take a node lock. This is the necessary step for preventing a race. After taking a lock, then we try to cmpxchg_double_slab

Re: [PATCH 1/4] slab: do ClearSlabPfmemalloc() for all pages of slab

2012-09-07 Thread JoonSoo Kim
2012/9/7 Mel Gorman mgor...@suse.de: This churns code a lot more than is necessary. How about this as a replacement patch? ---8--- From: Joonsoo Kim js1...@gmail.com Subject: [PATCH] slab: do ClearSlabPfmemalloc() for all pages of slab Right now, we call ClearSlabPfmemalloc() for first

Re: [PATCH v3 06/13] memcg: kmem controller infrastructure

2012-09-20 Thread JoonSoo Kim
Hi, Glauber. 2012/9/18 Glauber Costa glom...@parallels.com: +/* + * We need to verify if the allocation against current-mm-owner's memcg is + * possible for the given order. But the page is not allocated yet, so we'll + * need a further commit step to do the final arrangements. + * + * It

Re: [PATCH v3 15/16] memcg/sl[au]b: shrink dead caches

2012-09-20 Thread JoonSoo Kim
Hi Glauber. 2012/9/18 Glauber Costa glom...@parallels.com: diff --git a/mm/slub.c b/mm/slub.c index 0b68d15..9d79216 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2602,6 +2602,7 @@ redo: } else __slab_free(s, page, x, addr); + kmem_cache_verify_dead(s); } As

Re: [PATCH v3 06/13] memcg: kmem controller infrastructure

2012-09-21 Thread JoonSoo Kim
*_memcg = memcg should be executed when memcg_charge_kmem is success. memcg_charge_kmem return 0 if success in charging. Therefore, I think this code is wrong. If I am right, it is a serious bug that affect behavior of all the patchset. Which is precisely what it does. ret is a boolean, that

Re: [PATCH v3 15/16] memcg/sl[au]b: shrink dead caches

2012-09-21 Thread JoonSoo Kim
Hi, Glauber. 2012/9/18 Glauber Costa glom...@parallels.com: diff --git a/mm/slub.c b/mm/slub.c index 0b68d15..9d79216 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2602,6 +2602,7 @@ redo: } else __slab_free(s, page, x, addr); + kmem_cache_verify_dead(s); }

[RESEND PATCH 3/4 v3] mm: fix return value in __alloc_contig_migrate_range()

2012-07-27 Thread Joonsoo Kim
++tries == 5 never being checked. This in turn means that at the end of the function, ret may have a positive value, which should be treated as an error. This patch changes __alloc_contig_migrate_range() so that the return statement converts positive ret value into -EBUSY error. Signed-off-by: Joonsoo

[RESEND PATCH 1/4 v3] mm: correct return value of migrate_pages() and migrate_huge_pages()

2012-07-27 Thread Joonsoo Kim
() is identical case as migrate_pages() Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com Acked-by: Christoph Lameter c...@linux.com Acked-by: Michal Nazarewicz min...@mina86.com --- [Patch 2/4]: add Acked-by: Michal Nazarewicz min...@mina86.com [Patch 3/4]: commit log

[RESEND PATCH 2/4 v3] mm: fix possible incorrect return value of migrate_pages() syscall

2012-07-27 Thread Joonsoo Kim
Additionally, Correct comment above do_migrate_pages() Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Sasha Levin levinsasha...@gmail.com Cc: Christoph Lameter c...@linux.com Acked-by: Michal Nazarewicz min...@mina86.com diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 1d771e4..0732729 100644 --- a/mm

[RESEND PATCH 4/4 v3] mm: fix possible incorrect return value of move_pages() syscall

2012-07-27 Thread Joonsoo Kim
move_pages() syscall may return success in case that do_move_page_to_node_array return positive value which means migration failed. This patch changes return value of do_move_page_to_node_array for not returning positive value. It can fix the problem. Signed-off-by: Joonsoo Kim js1...@gmail.com

[RESEND PATCH] slub: reduce failure of this_cpu_cmpxchg in put_cpu_partial() after unfreezing

2012-07-27 Thread Joonsoo Kim
the cpu partial slabs is removed from cpu partial list. In this time, we could expect that this_cpu_cmpxchg is mostly succeed. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com Cc: David Rientjes rient...@google.com Acked-by: Christoph Lameter c...@linux.com --- Change log

[PATCH] slub: remove one code path and reduce lock contention in __slab_free()

2012-07-27 Thread Joonsoo Kim
-take a lock if necessary policy is helpful to this. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com --- This is v2 of slub: release a lock if freeing object with a lock is failed in __slab_free() Subject and commit log are changed from v1. Code is same as v1. diff

Re: [RESEND PATCH 4/4 v3] mm: fix possible incorrect return value of move_pages() syscall

2012-07-28 Thread JoonSoo Kim
2012/7/28 Christoph Lameter c...@linux.com: On Sat, 28 Jul 2012, Joonsoo Kim wrote: move_pages() syscall may return success in case that do_move_page_to_node_array return positive value which means migration failed. Nope. It only means that the migration for some pages has failed. This may

Re: [RESEND PATCH 2/4 v3] mm: fix possible incorrect return value of migrate_pages() syscall

2012-07-28 Thread JoonSoo Kim
2012/7/28 Christoph Lameter c...@linux.com: On Sat, 28 Jul 2012, Joonsoo Kim wrote: do_migrate_pages() can return the number of pages not migrated. Because migrate_pages() syscall return this value directly, migrate_pages() syscall may return the number of pages not migrated. In fail case

Re: [PATCH] slub: remove one code path and reduce lock contention in __slab_free()

2012-07-28 Thread JoonSoo Kim
2012/7/28 Christoph Lameter c...@linux.com: On Sat, 28 Jul 2012, Joonsoo Kim wrote: Subject and commit log are changed from v1. That looks a bit better. But the changelog could use more cleanup and clearer expression. @@ -2490,25 +2492,17 @@ static void __slab_free(struct kmem_cache *s

Re: [RESEND PATCH 4/4 v3] mm: fix possible incorrect return value of move_pages() syscall

2012-07-30 Thread JoonSoo Kim
2012/7/31 Christoph Lameter c...@linux.com: On Sat, 28 Jul 2012, JoonSoo Kim wrote: 2012/7/28 Christoph Lameter c...@linux.com: On Sat, 28 Jul 2012, Joonsoo Kim wrote: move_pages() syscall may return success in case that do_move_page_to_node_array return positive value which means

[PATCH 1/5] workqueue: use enum value to set array size of pools in gcwq

2012-08-13 Thread Joonsoo Kim
it makes code robust and prevent future mistakes. So change code to use this enum value. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 692d976..188eef8 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -183,7 +183,8 @@ struct global_cwq

[PATCH 2/5] workqueue: change value of lcpu in queue_delayed_work_on()

2012-08-13 Thread Joonsoo Kim
of WQ_NON_REENTRANT. Change it to cpu argument is prevent to go into sub-optimal path. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 188eef8..bc5c5e1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1158,6 +1158,8 @@ int

[PATCH 3/5] workqueue: introduce system_highpri_wq

2012-08-13 Thread Joonsoo Kim
properly. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index bc5c5e1..f69f094 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -269,12 +269,14 @@ struct workqueue_struct { }; struct workqueue_struct *system_wq __read_mostly; +struct

[PATCH 5/5] workqueue: use system_highpri_wq for unbind_work

2012-08-13 Thread Joonsoo Kim
To speed cpu down processing up, use system_highpri_wq. As scheduling priority of workers on it is higher than system_wq and it is not contended by other normal works on this cpu, work on it is processed faster than system_wq. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel

[PATCH 4/5] workqueue: use system_highpri_wq for highpri workers in rebind_workers()

2012-08-13 Thread Joonsoo Kim
theses. This implements it. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f69f094..e0e1d41 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -489,6 +489,11 @@ static int worker_pool_pri(struct worker_pool *pool) return pool

Re: [PATCH 2/5] workqueue: change value of lcpu in queue_delayed_work_on()

2012-08-13 Thread JoonSoo Kim
2012/8/14 Tejun Heo t...@kernel.org: Hello, On Tue, Aug 14, 2012 at 01:17:49AM +0900, Joonsoo Kim wrote: We assign cpu id into work struct in queue_delayed_work_on(). In current implementation, when work is come in first time, current running cpu id is assigned. If we do

Re: [PATCH 4/5] workqueue: use system_highpri_wq for highpri workers in rebind_workers()

2012-08-13 Thread JoonSoo Kim
I think it would be better to just opencode system_wq selection in rebind_workers(). Sorry for my poor English skill. Could you elaborate opencode system_wq selection means? Thanks! -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

Re: [PATCH 5/5] workqueue: use system_highpri_wq for unbind_work

2012-08-13 Thread JoonSoo Kim
2012/8/14 Tejun Heo t...@kernel.org: On Tue, Aug 14, 2012 at 01:17:52AM +0900, Joonsoo Kim wrote: To speed cpu down processing up, use system_highpri_wq. As scheduling priority of workers on it is higher than system_wq and it is not contended by other normal works on this cpu, work

Re: [PATCH 2/5] workqueue: change value of lcpu in queue_delayed_work_on()

2012-08-13 Thread JoonSoo Kim
And, do u mean @cpu is WORK_CPU_UNBOUND? @cpu could be WORK_CPU_UNBOUND at that point. The timer will be added to local CPU but @work-data would be pointing to WORK_CPU_UNBOUND, again triggering the condition. Given that @cpu being WORK_CPU_UNBOUND is far more common than an actual CPU

Re: [PATCH 4/5] workqueue: use system_highpri_wq for highpri workers in rebind_workers()

2012-08-13 Thread JoonSoo Kim
2012/8/14 Tejun Heo t...@kernel.org: On Tue, Aug 14, 2012 at 01:57:10AM +0900, JoonSoo Kim wrote: I think it would be better to just opencode system_wq selection in rebind_workers(). Sorry for my poor English skill. Could you elaborate opencode system_wq selection means? Dropping

Re: [PATCH 5/5] workqueue: use system_highpri_wq for unbind_work

2012-08-13 Thread JoonSoo Kim
2012/8/14 Tejun Heo t...@kernel.org: Hello, On Tue, Aug 14, 2012 at 02:02:31AM +0900, JoonSoo Kim wrote: 2012/8/14 Tejun Heo t...@kernel.org: On Tue, Aug 14, 2012 at 01:17:52AM +0900, Joonsoo Kim wrote: Is this from an actual workload? ie. do you have a test case where this matters

Re: [PATCH 2/5] workqueue: change value of lcpu in queue_delayed_work_on()

2012-08-14 Thread JoonSoo Kim
Why not just do if (cpu == WORK_CPU_UNBOUND) cpu = raw_smp_processor_id(); if (!(wq-flags...) { ... if (gcwq gcwq-cpu != WORK_CPU_UNBOUND) lcpu = gcwq-cpu; else

[PATCH v2 0/6] system_highpri_wq

2012-08-14 Thread Joonsoo Kim
are for our purpose. Joonsoo Kim (6): workqueue: use enum value to set array size of pools in gcwq workqueue: correct req_cpu in trace_workqueue_queue_work() workqueue: change value of lcpu in __queue_delayed_work_on() workqueue: introduce system_highpri_wq workqueue: use system_highpri_wq

[PATCH v2 2/6] workqueue: correct req_cpu in trace_workqueue_queue_work()

2012-08-14 Thread Joonsoo Kim
variable for storing local cpu. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 49d8f4a..6a17ab0 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1198,6 +1198,7 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct

[PATCH v2 4/6] workqueue: introduce system_highpri_wq

2012-08-14 Thread Joonsoo Kim
properly. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index f55ac26..470b0eb 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -269,12 +269,14 @@ struct workqueue_struct { }; struct workqueue_struct *system_wq __read_mostly; +struct

[PATCH v2 1/6] workqueue: use enum value to set array size of pools in gcwq

2012-08-14 Thread Joonsoo Kim
it makes code robust and prevent future mistakes. So change code to use this enum value. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4fef952..49d8f4a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -183,7 +183,8 @@ struct global_cwq

[PATCH v2 6/6] workqueue: use system_highpri_wq for unbind_work

2012-08-14 Thread Joonsoo Kim
To speed cpu down processing up, use system_highpri_wq. As scheduling priority of workers on it is higher than system_wq and it is not contended by other normal works on this cpu, work on it is processed faster than system_wq. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel

[PATCH v2 5/6] workqueue: use system_highpri_wq for highpri workers in rebind_workers()

2012-08-14 Thread Joonsoo Kim
theses. This implements it. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 470b0eb..4c5733c1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1738,6 +1738,7 @@ retry: /* rebind busy workers */ for_each_busy_worker

[PATCH v2 3/6] workqueue: change value of lcpu in __queue_delayed_work_on()

2012-08-14 Thread Joonsoo Kim
to go into sub-optimal path. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6a17ab0..f55ac26 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1358,9 +1358,10 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct

Re: [PATCH v2 2/6] workqueue: correct req_cpu in trace_workqueue_queue_work()

2012-08-14 Thread JoonSoo Kim
2012/8/15 Tejun Heo t...@kernel.org: Hello, On Wed, Aug 15, 2012 at 03:10:12AM +0900, Joonsoo Kim wrote: When we do tracing workqueue_queue_work(), it records requested cpu. But, if !(@wq-flag WQ_UNBOUND) and @cpu is WORK_CPU_UNBOUND, requested cpu is changed as local cpu. In case of @wq

[PATCH v3 6/6] workqueue: use system_highpri_wq for unbind_work

2012-08-15 Thread Joonsoo Kim
To speed cpu down processing up, use system_highpri_wq. As scheduling priority of workers on it is higher than system_wq and it is not contended by other normal works on this cpu, work on it is processed faster than system_wq. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel

[PATCH v3 4/6] workqueue: introduce system_highpri_wq

2012-08-15 Thread Joonsoo Kim
properly. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 32c4f79..a768ffd 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -269,12 +269,14 @@ struct workqueue_struct { }; struct workqueue_struct *system_wq __read_mostly; +struct

[PATCH v3 5/6] workqueue: use system_highpri_wq for highpri workers in rebind_workers()

2012-08-15 Thread Joonsoo Kim
theses. This implements it. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index a768ffd..2945734 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1742,6 +1742,7 @@ retry: /* rebind busy workers */ for_each_busy_worker

[PATCH v3 0/6] system_highpri_wq

2012-08-15 Thread Joonsoo Kim
This patchset introduce system_highpri_wq in order to use proper cwq for highpri worker. First 3 patches are not related to that purpose. Just fix arbitrary issues. Last 3 patches are for our purpose. Joonsoo Kim (6): workqueue: use enum value to set array size of pools in gcwq workqueue

[PATCH v3 2/6] workqueue: correct req_cpu in trace_workqueue_queue_work()

2012-08-15 Thread Joonsoo Kim
variable for storing requested cpu. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 49d8f4a..c29f2dc 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1198,6 +1198,7 @@ static void __queue_work(unsigned int cpu, struct

[PATCH v3 3/6] workqueue: change value of lcpu in __queue_delayed_work_on()

2012-08-15 Thread Joonsoo Kim
to go into sub-optimal path. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c29f2dc..32c4f79 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1356,9 +1356,16 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct

[PATCH v3 1/6] workqueue: use enum value to set array size of pools in gcwq

2012-08-15 Thread Joonsoo Kim
it makes code robust and prevent future mistakes. So change code to use this enum value. Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4fef952..49d8f4a 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -183,7 +183,8 @@ struct global_cwq

[PATCH 1/2] slub: reduce failure of this_cpu_cmpxchg in put_cpu_partial() after unfreezing

2012-08-15 Thread Joonsoo Kim
the cpu partial slabs is removed from cpu partial list. In this time, we could expect that this_cpu_cmpxchg is mostly succeed. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com Cc: David Rientjes rient...@google.com Acked-by: Christoph Lameter c...@linux.com --- Hello

[PATCH 2/2] slub: remove one code path and reduce lock contention in __slab_free()

2012-08-15 Thread Joonsoo Kim
we do retrying, status of slab is already changed, so we don't need a lock anymore in almost every case. release a lock first, and re-take a lock if necessary policy is helpful to this. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com Acked-by: Christoph Lameter c

[PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist

2012-08-15 Thread Joonsoo Kim
0 to objects count when we get for cpu freelist. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux.com Cc: David Rientjes rient...@google.com diff --git a/mm/slub.c b/mm/slub.c index efce427..88dca1d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1550,7 +1550,12 @@ static

Re: [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist

2012-08-15 Thread JoonSoo Kim
2012/8/16 Christoph Lameter c...@linux.com: On Thu, 16 Aug 2012, Joonsoo Kim wrote: s-cpu_partial determine the maximum number of objects kept in the per cpu partial lists of a processor. Currently, it is used for not only per cpu partial list but also cpu freelist. Therefore

Re: [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist

2012-08-16 Thread JoonSoo Kim
I think that s-cpu_partial is for cpu partial slab, not cpu slab. Ummm... Not entirely. s-cpu_partial is the mininum number of objects to cache per processor. This includes the objects available in the per cpu slab and the other slabs on the per cpu partial list. Hmm.. When we do test for

Re: [PATCH 2/2] slub: remove one code path and reduce lock contention in __slab_free()

2012-08-24 Thread JoonSoo Kim
2012/8/16 Joonsoo Kim js1...@gmail.com: When we try to free object, there is some of case that we need to take a node lock. This is the necessary step for preventing a race. After taking a lock, then we try to cmpxchg_double_slab(). But, there is a possible scenario that cmpxchg_double_slab

[PATCH 1/2] slub: rename cpu_partial to max_cpu_object

2012-08-24 Thread Joonsoo Kim
cpu_partial of kmem_cache struct is a bit awkward. It means the maximum number of objects kept in the per cpu slab and cpu partial lists of a processor. However, current name seems to represent objects kept in the cpu partial lists only. So, this patch renames it. Signed-off-by: Joonsoo Kim js1

[PATCH 2/2] slub: correct the calculation of the number of cpu objects in get_partial_node

2012-08-24 Thread Joonsoo Kim
same meaning in both case and rename available to cpu_slab_objects for readability. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Christoph Lameter c...@linux-foundation.org diff --git a/mm/slub.c b/mm/slub.c index d597530..c96e0e4 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1538,6 +1538,7

Re: [PATCH 2/2] slub: correct the calculation of the number of cpu objects in get_partial_node

2012-08-24 Thread JoonSoo Kim
2012/8/25 Christoph Lameter c...@linux.com: On Sat, 25 Aug 2012, Joonsoo Kim wrote: index d597530..c96e0e4 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1538,6 +1538,7 @@ static void *get_partial_node(struct kmem_cache *s, { struct page *page, *page2; void *object = NULL

Re: [PATCH 2/2] slub: correct the calculation of the number of cpu objects in get_partial_node

2012-08-24 Thread JoonSoo Kim
2012/8/25 Christoph Lameter c...@linux.com: On Sat, 25 Aug 2012, JoonSoo Kim wrote: But, when using cpu_partial_objects, I have a coding style problem. if (kmem_cache_debug(s) || cpu_slab_objects + cpu_partial_objects

[PATCH] slub: consider pfmemalloc_match() in get_partial_node()

2012-08-24 Thread Joonsoo Kim
() in get_partial_node() It prevent deactivate - re-get in get_partial. Instead, new_slab() is called. It may return !PFMEMALLOC page, so above situation will be suspended sometime. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: David Miller da...@davemloft.net Cc: Neil Brown ne...@suse.de Cc: Peter Zijlstra

[PATCH 1/2] slab: do ClearSlabPfmemalloc() for all pages of slab

2012-08-25 Thread Joonsoo Kim
Now, we just do ClearSlabPfmemalloc() for first page of slab when we clear SlabPfmemalloc flag. It is a problem because we sometimes test flag of page which is not first page of slab in __ac_put_obj(). So add code to do ClearSlabPfmemalloc for all pages of slab. Signed-off-by: Joonsoo Kim js1

[PATCH 2/2] slab: fix starting index for finding another object

2012-08-25 Thread Joonsoo Kim
In array cache, there is a object at index 0. So fix it. Signed-off-by: Joonsoo Kim js1...@gmail.com Cc: Mel Gorman mgor...@suse.de Cc: Christoph Lameter c...@linux-foundation.org diff --git a/mm/slab.c b/mm/slab.c index 45cf59a..eb74bf5 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -976,7 +976,7

Re: [PATCH RESEND] mm: Restructure kmem_cache_create() to move debug cache integrity checks into a new function

2012-08-06 Thread JoonSoo Kim
diff --git a/mm/slab_common.c b/mm/slab_common.c index 12637ce..08bc2a4 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -23,6 +23,41 @@ enum slab_state slab_state; LIST_HEAD(slab_caches); DEFINE_MUTEX(slab_mutex); +static int kmem_cache_sanity_check(const char *name, size_t

Re: [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist

2012-08-17 Thread JoonSoo Kim
2012/8/17 Christoph Lameter c...@linux.com: On Thu, 16 Aug 2012, JoonSoo Kim wrote: But, if you prefer that s-cpu_partial is for both cpu slab and cpu partial slab, get_partial_node() needs an another minor fix. We should add number of objects in cpu slab when we refill cpu partial slab

Re: [PATCH v3 0/6] system_highpri_wq

2012-08-17 Thread JoonSoo Kim
2012/8/17 Tejun Heo t...@kernel.org: On Wed, Aug 15, 2012 at 11:25:35PM +0900, Joonsoo Kim wrote: Change from v2 [1/6] No change [2/6] Change local variable name and use it directly for TP [3/6] Add a comment. [4/6] No change [5/6] Add a comment. Fix ugly indentation. [6/6] No change

Re: [PATCH] slub: try to get cpu partial slab even if we get enough objects for cpu freelist

2012-08-17 Thread JoonSoo Kim
2012/8/17 Christoph Lameter c...@linux.com: On Fri, 17 Aug 2012, JoonSoo Kim wrote: What difference does this patch make? At the end of the day you need the total number of objects available in the partial slabs and the cpu slab for comparison. It doesn't induce any large difference

[PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread Joonsoo Kim
__alloc_pages_direct_compact has many arguments so invoking it is very costly. And in almost invoking case, order is 0, so return immediately. Let's not invoke it when order 0 Signed-off-by: Joonsoo Kim js1...@gmail.com diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 6092f33..f4039aa

Re: [PATCH] mm: don't invoke __alloc_pages_direct_compact when order 0

2012-07-06 Thread JoonSoo Kim
2012/7/7 Minchan Kim minc...@kernel.org: Hi Joonsoo, On Sat, Jul 07, 2012 at 12:28:41AM +0900, Joonsoo Kim wrote: __alloc_pages_direct_compact has many arguments so invoking it is very costly. It's already slow path so it's pointless for such optimization. I know this is so minor

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