Re: [RFC v2 1/3] migrate: new struct migration and add it to struct page

2015-10-19 Thread Hui Zhu
On Thu, Oct 15, 2015 at 5:53 PM, Minchan Kim <minc...@kernel.org> wrote: > On Thu, Oct 15, 2015 at 11:27:15AM +0200, Vlastimil Babka wrote: >> On 10/15/2015 11:09 AM, Hui Zhu wrote: >> >I got that add function interfaces is really not a good idea. >> >So I add

Re: [PATCH] zsmalloc: remove unless line in obj_free

2015-10-13 Thread Hui Zhu
Thanks. I will post a new version later. Best, Hui On Tue, Oct 13, 2015 at 4:00 PM, Sergey Senozhatsky wrote: > On (10/13/15 14:31), Hui Zhu wrote: >> Signed-off-by: Hui Zhu > > s/unless/useless/ > > other than that > > Reviewed-by: Sergey Senozhatsky >

[PATCH v2] zsmalloc: remove useless line in obj_free

2015-10-13 Thread Hui Zhu
Signed-off-by: Hui Zhu Reviewed-by: Sergey Senozhatsky --- mm/zsmalloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..c7338f0 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1428,8 +1428,6 @@ static void obj_free(struct zs_pool *pool

[PATCH] zsmalloc: remove unless line in obj_free

2015-10-13 Thread Hui Zhu
Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..c7338f0 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1428,8 +1428,6 @@ static void obj_free(struct zs_pool *pool, struct size_class *class

[PATCH] zsmalloc: remove unless line in obj_free

2015-10-13 Thread Hui Zhu
Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..c7338f0 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1428,8 +1428,6 @@ static void obj_free(struct zs_pool *pool,

[PATCH v2] zsmalloc: remove useless line in obj_free

2015-10-13 Thread Hui Zhu
Signed-off-by: Hui Zhu <zhu...@xiaomi.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> --- mm/zsmalloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..c7338f0 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -14

Re: [PATCH] zsmalloc: remove unless line in obj_free

2015-10-13 Thread Hui Zhu
Thanks. I will post a new version later. Best, Hui On Tue, Oct 13, 2015 at 4:00 PM, Sergey Senozhatsky <sergey.senozhatsky.w...@gmail.com> wrote: > On (10/13/15 14:31), Hui Zhu wrote: >> Signed-off-by: Hui Zhu <zhu...@xiaomi.com> > > s/unless/useless/ > > other

[PATCH v2] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-06 Thread Hui Zhu
e reason why there is no problem until now is huge-class page is born with ZS_FULL so it couldn't be migrated. Therefore, it shouldn't be real bug in practice. However, we need this patch for future-work "VM-aware zsmalloced page migration" to reduce external fragmentation. Signed-off-by: Hui

Re: [PATCH] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-06 Thread Hui Zhu
On Tue, Oct 6, 2015 at 9:54 PM, Minchan Kim wrote: > Hello, > > On Mon, Oct 05, 2015 at 04:23:01PM +0800, Hui Zhu wrote: >> In function obj_malloc: >> if (!class->huge) >> /* record handle in the header of allocated chunk */ >>

Re: [PATCH] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-06 Thread Hui Zhu
On Tue, Oct 6, 2015 at 9:54 PM, Minchan Kim <minc...@kernel.org> wrote: > Hello, > > On Mon, Oct 05, 2015 at 04:23:01PM +0800, Hui Zhu wrote: >> In function obj_malloc: >> if (!class->huge) >> /* record handle in the header of allocated ch

[PATCH v2] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-06 Thread Hui Zhu
e reason why there is no problem until now is huge-class page is born with ZS_FULL so it couldn't be migrated. Therefore, it shouldn't be real bug in practice. However, we need this patch for future-work "VM-aware zsmalloced page migration" to reduce external fragmentation. Signed-off-by: Hui

[PATCH] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-05 Thread Hui Zhu
page_private(page) as value but not pointer in obj_to_head. Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..e881d4f 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -824,7 +824,7 @@ static u

[PATCH] zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

2015-10-05 Thread Hui Zhu
page_private(page) as value but not pointer in obj_to_head. Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..e881d4f 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.

[PATCH v2] zsmalloc: add comments for ->inuse to zspage

2015-09-24 Thread Hui Zhu
Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..f62f2fb 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -38,6 +38,7 @@ * page->lru: links together first pages of various zspa

[PATCH v2] zsmalloc: add comments for ->inuse to zspage

2015-09-24 Thread Hui Zhu
Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..f62f2fb 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -38,6 +38,7 @@ * page->lru: links together first pages of variou

[PATCH] zsmalloc: add comments for ->inuse to zspage

2015-09-22 Thread Hui Zhu
Signed-off-by: Hui Zhu --- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..1f66d5b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -38,6 +38,7 @@ * page->lru: links together first pages of various zspa

[PATCH] zsmalloc: add comments for ->inuse to zspage

2015-09-22 Thread Hui Zhu
Signed-off-by: Hui Zhu <zhu...@xiaomi.com> --- mm/zsmalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index f135b1b..1f66d5b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -38,6 +38,7 @@ * page->lru: links together first pages of variou

Call for Topics and Sponsors

2015-06-25 Thread Hui Zhu
* Call for Topics and Sponsors Workshop on Open Source Development Tools 2015 Beijing, China Sep. 12, 2015 (TBD) HelloGCC Work Group (www.hellogcc.org) *

Call for Topics and Sponsors

2015-06-25 Thread Hui Zhu
* Call for Topics and Sponsors Workshop on Open Source Development Tools 2015 Beijing, China Sep. 12, 2015 (TBD) HelloGCC Work Group (www.hellogcc.org) *

Re: [PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-06 Thread Hui Zhu
On Wed, May 6, 2015 at 2:28 PM, Joonsoo Kim wrote: > On Tue, May 05, 2015 at 11:22:59AM +0800, Hui Zhu wrote: >> Change pfn_present to pfn_valid_within according to the review of Laura. >> >> I got a issue: >> [ 214.294917] Unable to handle kernel NULL pointer derefer

[PATCH v3] CMA: page_isolation: check buddy before access it

2015-05-06 Thread Hui Zhu
dx - page_idx); if (!is_migrate_isolate_page(buddy)) { But the begin addr of this part of CMA memory is very close to a part of memory that is reserved in the boot time (not in buddy system). So add a check before access it. Suggested-by: Laura Abbott Suggested-by: Joonsoo Kim Signed-off-by: Hui Zhu --- mm/page_is

Re: [PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-06 Thread Hui Zhu
On Wed, May 6, 2015 at 2:28 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: On Tue, May 05, 2015 at 11:22:59AM +0800, Hui Zhu wrote: Change pfn_present to pfn_valid_within according to the review of Laura. I got a issue: [ 214.294917] Unable to handle kernel NULL pointer dereference at virtual

[PATCH v3] CMA: page_isolation: check buddy before access it

2015-05-06 Thread Hui Zhu
Abbott labb...@redhat.com Suggested-by: Joonsoo Kim iamjoonsoo@lge.com Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 755a42c..4a5624c 100644 --- a/mm

Re: [PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-05 Thread Hui Zhu
On Wed, May 6, 2015 at 5:29 AM, Andrew Morton wrote: > On Tue, 5 May 2015 11:22:59 +0800 Hui Zhu wrote: > >> Change pfn_present to pfn_valid_within according to the review of Laura. >> >> I got a issue: >> [ 214.294917] Unable to handle kernel NULL pointer dere

Re: [PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-05 Thread Hui Zhu
On Wed, May 6, 2015 at 5:29 AM, Andrew Morton a...@linux-foundation.org wrote: On Tue, 5 May 2015 11:22:59 +0800 Hui Zhu zhu...@xiaomi.com wrote: Change pfn_present to pfn_valid_within according to the review of Laura. I got a issue: [ 214.294917] Unable to handle kernel NULL pointer

[PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
emory is very close to a part of memory that is reserved in the boot time (not in buddy system). So add a check before access it. Signed-off-by: Hui Zhu --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 755

Re: [PATCH] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
On Tue, May 5, 2015 at 2:34 AM, Laura Abbott wrote: > On 05/04/2015 02:41 AM, Hui Zhu wrote: >> >> I got a issue: >> [ 214.294917] Unable to handle kernel NULL pointer dereference at virtual >> address 082a >> [ 214.303013] pgd = cc97 >>

[PATCH] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
(not in buddy system). So add a check before access it. Signed-off-by: Hui Zhu --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm/page_isolation.c index 755a42c..434730b 100644 --- a/mm/page_isolation.c +++ b/mm/page_isolation.c @@

[PATCH] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
memory is very close to a part of memory that is reserved in the boot time (not in buddy system). So add a check before access it. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/page_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/page_isolation.c b/mm

Re: [PATCH] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
On Tue, May 5, 2015 at 2:34 AM, Laura Abbott labb...@redhat.com wrote: On 05/04/2015 02:41 AM, Hui Zhu wrote: I got a issue: [ 214.294917] Unable to handle kernel NULL pointer dereference at virtual address 082a [ 214.303013] pgd = cc97 [ 214.305721] [082a] *pgd=

[PATCH v2] CMA: page_isolation: check buddy before access it

2015-05-04 Thread Hui Zhu
); if (!is_migrate_isolate_page(buddy)) { But the begin addr of this part of CMA memory is very close to a part of memory that is reserved in the boot time (not in buddy system). So add a check before access it. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/page_isolation.c | 3 ++- 1 file changed, 2

Re: [PATCH] CMA: treat free cma pages as non-free if not ALLOC_CMA on watermark checking

2015-01-18 Thread Hui Zhu
On Mon, Jan 19, 2015 at 2:55 PM, Minchan Kim wrote: > Hello, > > On Sun, Jan 18, 2015 at 04:32:59PM +0800, Hui Zhu wrote: >> From: Hui Zhu >> >> The original of this patch [1] is part of Joonsoo's CMA patch series. >> I made a patch [2] to fix the issue of

Re: [PATCH] mm/page_alloc: Fix race conditions on getting migratetype in buffered_rmqueue

2015-01-18 Thread Hui Zhu
On Sun, Jan 18, 2015 at 6:19 PM, Vlastimil Babka wrote: > On 18.1.2015 10:17, Hui Zhu wrote: >> >> From: Hui Zhu >> >> To test the patch [1], I use KGTP and a script [2] to show >> NR_FREE_CMA_PAGES >> and gross of cma_nr_free. The values are always not s

[PATCH] mm/page_alloc: Fix race conditions on getting migratetype in buffered_rmqueue

2015-01-18 Thread Hui Zhu
From: Hui Zhu To test the patch [1], I use KGTP and a script [2] to show NR_FREE_CMA_PAGES and gross of cma_nr_free. The values are always not same. I check the code of pages alloc and free and found that race conditions on getting migratetype in buffered_rmqueue. Then I add move the code

[PATCH] CMA: treat free cma pages as non-free if not ALLOC_CMA on watermark checking

2015-01-18 Thread Hui Zhu
From: Hui Zhu The original of this patch [1] is part of Joonsoo's CMA patch series. I made a patch [2] to fix the issue of this patch. Joonsoo reminded me that this issue affect current kernel too. So made a new one for upstream. Current code treat free cma pages as non-free if not ALLOC_CMA

Re: [PATCH] mm/page_alloc: Fix race conditions on getting migratetype in buffered_rmqueue

2015-01-18 Thread Hui Zhu
On Sun, Jan 18, 2015 at 6:19 PM, Vlastimil Babka vba...@suse.cz wrote: On 18.1.2015 10:17, Hui Zhu wrote: From: Hui Zhu zhu...@xiaomi.com To test the patch [1], I use KGTP and a script [2] to show NR_FREE_CMA_PAGES and gross of cma_nr_free. The values are always not same. I check the code

Re: [PATCH] CMA: treat free cma pages as non-free if not ALLOC_CMA on watermark checking

2015-01-18 Thread Hui Zhu
On Mon, Jan 19, 2015 at 2:55 PM, Minchan Kim minc...@kernel.org wrote: Hello, On Sun, Jan 18, 2015 at 04:32:59PM +0800, Hui Zhu wrote: From: Hui Zhu zhu...@xiaomi.com The original of this patch [1] is part of Joonsoo's CMA patch series. I made a patch [2] to fix the issue of this patch

[PATCH] CMA: treat free cma pages as non-free if not ALLOC_CMA on watermark checking

2015-01-18 Thread Hui Zhu
From: Hui Zhu zhu...@xiaomi.com The original of this patch [1] is part of Joonsoo's CMA patch series. I made a patch [2] to fix the issue of this patch. Joonsoo reminded me that this issue affect current kernel too. So made a new one for upstream. Current code treat free cma pages as non-free

[PATCH] mm/page_alloc: Fix race conditions on getting migratetype in buffered_rmqueue

2015-01-18 Thread Hui Zhu
From: Hui Zhu zhu...@xiaomi.com To test the patch [1], I use KGTP and a script [2] to show NR_FREE_CMA_PAGES and gross of cma_nr_free. The values are always not same. I check the code of pages alloc and free and found that race conditions on getting migratetype in buffered_rmqueue. Then I add

Re: [PATCH] CMA: Fix CMA's page number is substructed twice in __zone_watermark_ok

2015-01-07 Thread Hui Zhu
On Wed, Jan 7, 2015 at 4:45 PM, Vlastimil Babka wrote: > On 12/30/2014 11:17 AM, Hui Zhu wrote: >> The original of this patch [1] is used to fix the issue in Joonsoo's CMA >> patch >> "CMA: always treat free cma pages as non-free on watermark checking"

Re: [PATCH] CMA: Fix CMA's page number is substructed twice in __zone_watermark_ok

2015-01-07 Thread Hui Zhu
On Wed, Jan 7, 2015 at 4:45 PM, Vlastimil Babka vba...@suse.cz wrote: On 12/30/2014 11:17 AM, Hui Zhu wrote: The original of this patch [1] is used to fix the issue in Joonsoo's CMA patch CMA: always treat free cma pages as non-free on watermark checking [2]. Joonsoo reminded me

[PATCH] samples: hw_breakpoint: check the return value of kallsyms_lookup_name

2015-01-03 Thread Hui Zhu
data_breakpoint.ko can insert successful but cannot catch any change of the data in my part because kallsyms_lookup_name rerurn 0 each time. So add code to check the return value of kallsyms_lookup_name. Signed-off-by: Hui Zhu --- samples/hw_breakpoint/data_breakpoint.c | 17

[PATCH] samples: hw_breakpoint: check the return value of kallsyms_lookup_name

2015-01-03 Thread Hui Zhu
data_breakpoint.ko can insert successful but cannot catch any change of the data in my part because kallsyms_lookup_name rerurn 0 each time. So add code to check the return value of kallsyms_lookup_name. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- samples/hw_breakpoint/data_breakpoint.c | 17

[PATCH] CMA: Fix CMA's page number is substructed twice in __zone_watermark_ok

2014-12-30 Thread Hui Zhu
ed twice. This bug will make __zone_watermark_ok return more false. This patch add cma_free_area to struct free_area that just record the number of CMA pages. And add it back in the order loop to handle the substruct twice issue. [1] https://lkml.org/lkml/2014/12/25/43 [2] https://lkml.org/lkml/2014

Re: [PATCH 1/3] CMA: Fix the bug that CMA's page number is substructed twice

2014-12-30 Thread Hui Zhu
On Tue, Dec 30, 2014 at 12:48 PM, Joonsoo Kim wrote: > On Thu, Dec 25, 2014 at 05:43:26PM +0800, Hui Zhu wrote: >> In Joonsoo's CMA patch "CMA: always treat free cma pages as non-free on >> watermark checking" [1], it changes __zone_watermark_ok to substruct CMA >&g

Re: [PATCH 1/3] CMA: Fix the bug that CMA's page number is substructed twice

2014-12-30 Thread Hui Zhu
On Tue, Dec 30, 2014 at 12:48 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: On Thu, Dec 25, 2014 at 05:43:26PM +0800, Hui Zhu wrote: In Joonsoo's CMA patch CMA: always treat free cma pages as non-free on watermark checking [1], it changes __zone_watermark_ok to substruct CMA pages number from

[PATCH] CMA: Fix CMA's page number is substructed twice in __zone_watermark_ok

2014-12-30 Thread Hui Zhu
__zone_watermark_ok return more false. This patch add cma_free_area to struct free_area that just record the number of CMA pages. And add it back in the order loop to handle the substruct twice issue. [1] https://lkml.org/lkml/2014/12/25/43 [2] https://lkml.org/lkml/2014/5/28/110 Signed-off-by: Hui Zhu zhu

[PATCH 0/3] CMA: Handle the issues of aggressively allocate the

2014-12-25 Thread Hui Zhu
to handle the issues. And I merged cma_alloc_counter from [2] to cma_alloc work better. This patchset is based on aa39477b5692611b91ac9455ae588738852b3f60 and [1]. [1] https://lkml.org/lkml/2014/5/28/64 [2] https://lkml.org/lkml/2014/10/15/623 Hui Zhu (3): CMA: Fix the bug that CMA's page number

[PATCH 3/3] CMA: Add cma_alloc_counter to make cma_alloc work better if it meet busy range

2014-12-25 Thread Hui Zhu
__rmqueue doesn't call __rmqueue_cma when cma_alloc works. [1] https://lkml.org/lkml/2014/10/24/26 Signed-off-by: Hui Zhu --- include/linux/cma.h | 2 ++ mm/cma.c| 6 ++ mm/page_alloc.c | 8 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/linux

[PATCH 1/3] CMA: Fix the bug that CMA's page number is substructed twice

2014-12-25 Thread Hui Zhu
t twice issue. [1] https://lkml.org/lkml/2014/5/28/110 Signed-off-by: Hui Zhu Signed-off-by: Weixing Liu --- include/linux/mmzone.h | 3 +++ mm/page_alloc.c| 29 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/l

[PATCH 2/3] CMA: Fix the issue that nr_try_movable just count MIGRATE_MOVABLE memory

2014-12-25 Thread Hui Zhu
thers. This device allocated a lot of MIGRATE_UNMOVABLE memory affect the behavior of this zone memory allocation. This patch change __rmqueue to let nr_try_movable record all the memory allocation of normal memory. [1] https://lkml.org/lkml/2014/5/28/64 Signed-off-by: Hui Zhu Signed-off-by: W

[PATCH 2/3] CMA: Fix the issue that nr_try_movable just count MIGRATE_MOVABLE memory

2014-12-25 Thread Hui Zhu
allocated a lot of MIGRATE_UNMOVABLE memory affect the behavior of this zone memory allocation. This patch change __rmqueue to let nr_try_movable record all the memory allocation of normal memory. [1] https://lkml.org/lkml/2014/5/28/64 Signed-off-by: Hui Zhu zhu...@xiaomi.com Signed-off-by: Weixing Liu

[PATCH 1/3] CMA: Fix the bug that CMA's page number is substructed twice

2014-12-25 Thread Hui Zhu
/28/110 Signed-off-by: Hui Zhu zhu...@xiaomi.com Signed-off-by: Weixing Liu liuweix...@xiaomi.com --- include/linux/mmzone.h | 3 +++ mm/page_alloc.c| 29 - 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux

[PATCH 3/3] CMA: Add cma_alloc_counter to make cma_alloc work better if it meet busy range

2014-12-25 Thread Hui Zhu
__rmqueue doesn't call __rmqueue_cma when cma_alloc works. [1] https://lkml.org/lkml/2014/10/24/26 Signed-off-by: Hui Zhu zhu...@xiaomi.com --- include/linux/cma.h | 2 ++ mm/cma.c| 6 ++ mm/page_alloc.c | 8 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git

[PATCH 0/3] CMA: Handle the issues of aggressively allocate the

2014-12-25 Thread Hui Zhu
to handle the issues. And I merged cma_alloc_counter from [2] to cma_alloc work better. This patchset is based on aa39477b5692611b91ac9455ae588738852b3f60 and [1]. [1] https://lkml.org/lkml/2014/5/28/64 [2] https://lkml.org/lkml/2014/10/15/623 Hui Zhu (3): CMA: Fix the bug that CMA's page number

Re: [PATCH 4/4] (CMA_AGGRESSIVE) Update page alloc function

2014-11-27 Thread Hui Zhu
On Fri, Oct 24, 2014 at 1:28 PM, Joonsoo Kim wrote: > On Thu, Oct 16, 2014 at 11:35:51AM +0800, Hui Zhu wrote: >> If page alloc function __rmqueue try to get pages from MIGRATE_MOVABLE and >> conditions (cma_alloc_counter, cma_aggressive_free_min, cma_alloc_counter) >&g

Re: [PATCH 4/4] (CMA_AGGRESSIVE) Update page alloc function

2014-11-27 Thread Hui Zhu
On Fri, Oct 24, 2014 at 1:28 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: On Thu, Oct 16, 2014 at 11:35:51AM +0800, Hui Zhu wrote: If page alloc function __rmqueue try to get pages from MIGRATE_MOVABLE and conditions (cma_alloc_counter, cma_aggressive_free_min, cma_alloc_counter) allow

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-04 Thread Hui Zhu
On Tue, Nov 4, 2014 at 3:53 PM, Minchan Kim wrote: > Hello, > > On Wed, Oct 29, 2014 at 03:43:33PM +0100, Vlastimil Babka wrote: >> On 10/16/2014 10:55 AM, Laura Abbott wrote: >> >On 10/15/2014 8:35 PM, Hui Zhu wrote: >> > >> >It's good to see another pr

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-04 Thread Hui Zhu
On Tue, Nov 4, 2014 at 3:53 PM, Minchan Kim minc...@kernel.org wrote: Hello, On Wed, Oct 29, 2014 at 03:43:33PM +0100, Vlastimil Babka wrote: On 10/16/2014 10:55 AM, Laura Abbott wrote: On 10/15/2014 8:35 PM, Hui Zhu wrote: It's good to see another proposal to fix CMA utilization. Do you

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-03 Thread Hui Zhu
On Wed, Oct 29, 2014 at 10:43 PM, Vlastimil Babka wrote: > On 10/16/2014 10:55 AM, Laura Abbott wrote: >> >> On 10/15/2014 8:35 PM, Hui Zhu wrote: >> >> It's good to see another proposal to fix CMA utilization. Do you have >> any data about the success rate o

Re: [PATCH v5 2/4] mm/page_alloc: add freepage on isolate pageblock to correct buddy list

2014-11-03 Thread Hui Zhu
On Mon, Nov 3, 2014 at 4:22 PM, Heesub Shin wrote: > Hello, > > > On 10/31/2014 04:25 PM, Joonsoo Kim wrote: >> >> In free_pcppages_bulk(), we use cached migratetype of freepage >> to determine type of buddy list where freepage will be added. >> This information is stored when freepage is added

Re: [PATCH v5 2/4] mm/page_alloc: add freepage on isolate pageblock to correct buddy list

2014-11-03 Thread Hui Zhu
On Mon, Nov 3, 2014 at 4:22 PM, Heesub Shin heesub.s...@samsung.com wrote: Hello, On 10/31/2014 04:25 PM, Joonsoo Kim wrote: In free_pcppages_bulk(), we use cached migratetype of freepage to determine type of buddy list where freepage will be added. This information is stored when freepage

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-03 Thread Hui Zhu
On Wed, Oct 29, 2014 at 10:43 PM, Vlastimil Babka vba...@suse.cz wrote: On 10/16/2014 10:55 AM, Laura Abbott wrote: On 10/15/2014 8:35 PM, Hui Zhu wrote: It's good to see another proposal to fix CMA utilization. Do you have any data about the success rate of CMA contiguous allocation after

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-02 Thread Hui Zhu
On Fri, Oct 24, 2014 at 1:25 PM, Joonsoo Kim wrote: > On Thu, Oct 16, 2014 at 11:35:47AM +0800, Hui Zhu wrote: >> In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of >> MIGRATE_MOVABLE. >> MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in >> o

Re: [PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-11-02 Thread Hui Zhu
On Fri, Oct 24, 2014 at 1:25 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: On Thu, Oct 16, 2014 at 11:35:47AM +0800, Hui Zhu wrote: In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of MIGRATE_MOVABLE. MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in order

Re: [PATCH v2 2/3] CMA: aggressively allocate the pages on cma reserved memory when not used

2014-10-30 Thread Hui Zhu
On Wed, May 28, 2014 at 3:04 PM, Joonsoo Kim wrote: > CMA is introduced to provide physically contiguous pages at runtime. > For this purpose, it reserves memory at boot time. Although it reserve > memory, this reserved memory can be used for movable memory allocation > request. This usecase is

Re: [PATCH v2 2/3] CMA: aggressively allocate the pages on cma reserved memory when not used

2014-10-30 Thread Hui Zhu
On Wed, May 28, 2014 at 3:04 PM, Joonsoo Kim iamjoonsoo@lge.com wrote: CMA is introduced to provide physically contiguous pages at runtime. For this purpose, it reserves memory at boot time. Although it reserve memory, this reserved memory can be used for movable memory allocation request.

[PATCH v2 3/4] (CMA_AGGRESSIVE) Update reserve custom contiguous area code

2014-10-17 Thread Hui Zhu
guous area, increase the value of cma_alloc_counter. CMA_AGGRESSIVE will not work in page alloc code. After reserve custom contiguous area function return, decreases the value of cma_alloc_counter. Signed-off-by: Hui Zhu --- include/linux/cma.h | 7 +++ kernel/sysctl.c | 27 +++

[PATCH v2 2/4] (CMA_AGGRESSIVE) Add new function shrink_all_memory_for_cma

2014-10-17 Thread Hui Zhu
Update this patch according to the comments from Rafael. Function shrink_all_memory_for_cma try to free `nr_to_reclaim' of memory. CMA aggressive shrink function will call this functon to free `nr_to_reclaim' of memory. Signed-off-by: Hui Zhu --- mm/vmscan.c | 58

[PATCH v2 2/4] (CMA_AGGRESSIVE) Add new function shrink_all_memory_for_cma

2014-10-17 Thread Hui Zhu
Update this patch according to the comments from Rafael. Function shrink_all_memory_for_cma try to free `nr_to_reclaim' of memory. CMA aggressive shrink function will call this functon to free `nr_to_reclaim' of memory. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/vmscan.c | 58

[PATCH v2 3/4] (CMA_AGGRESSIVE) Update reserve custom contiguous area code

2014-10-17 Thread Hui Zhu
. CMA_AGGRESSIVE will not work in page alloc code. After reserve custom contiguous area function return, decreases the value of cma_alloc_counter. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- include/linux/cma.h | 7 +++ kernel/sysctl.c | 27 +++ mm/cma.c

[PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-10-15 Thread Hui Zhu
In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of MIGRATE_MOVABLE. MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in order that Linux kernel want. If a system that has a lot of user space program is running, for instance, an Android board, most of memory is in

[PATCH 2/4] (CMA_AGGRESSIVE) Add argument hibernation to function shrink_all_memory

2014-10-15 Thread Hui Zhu
is hibernate_preallocate_memory. if not, the caller is CMA alloc function. Signed-off-by: Hui Zhu --- include/linux/swap.h| 3 ++- kernel/power/snapshot.c | 2 +- mm/vmscan.c | 19 +-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/linux/swap.h b/include

[PATCH 4/4] (CMA_AGGRESSIVE) Update page alloc function

2014-10-15 Thread Hui Zhu
If page alloc function __rmqueue try to get pages from MIGRATE_MOVABLE and conditions (cma_alloc_counter, cma_aggressive_free_min, cma_alloc_counter) allow, MIGRATE_CMA will be allocated as MIGRATE_MOVABLE first. Signed-off-by: Hui Zhu --- mm/page_alloc.c | 42

[PATCH 3/4] (CMA_AGGRESSIVE) Update reserve custom contiguous area code

2014-10-15 Thread Hui Zhu
work in page alloc code. After reserve custom contiguous area function return, decreases the value of cma_alloc_counter. Signed-off-by: Hui Zhu --- include/linux/cma.h | 7 +++ kernel/sysctl.c | 27 +++ mm/cma.c| 54

[PATCH 1/4] (CMA_AGGRESSIVE) Add CMA_AGGRESSIVE to Kconfig

2014-10-15 Thread Hui Zhu
switch (sysctl vm.cma-aggressive-switch) will be opened. When system boot, this value will set to sysctl "vm.cma-aggressive-free-min". If this value is true, sysctl "vm.cma-aggressive-shrink-switch" will be set to true when Linux boot. Signed-off-by: Hui Zhu

[PATCH 3/4] (CMA_AGGRESSIVE) Update reserve custom contiguous area code

2014-10-15 Thread Hui Zhu
reserve custom contiguous area function return, decreases the value of cma_alloc_counter. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- include/linux/cma.h | 7 +++ kernel/sysctl.c | 27 +++ mm/cma.c| 54

[PATCH 1/4] (CMA_AGGRESSIVE) Add CMA_AGGRESSIVE to Kconfig

2014-10-15 Thread Hui Zhu
switch (sysctl vm.cma-aggressive-switch) will be opened. When system boot, this value will set to sysctl vm.cma-aggressive-free-min. If this value is true, sysctl vm.cma-aggressive-shrink-switch will be set to true when Linux boot. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/Kconfig | 43

[PATCH 2/4] (CMA_AGGRESSIVE) Add argument hibernation to function shrink_all_memory

2014-10-15 Thread Hui Zhu
is hibernate_preallocate_memory. if not, the caller is CMA alloc function. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- include/linux/swap.h| 3 ++- kernel/power/snapshot.c | 2 +- mm/vmscan.c | 19 +-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/linux

[PATCH 4/4] (CMA_AGGRESSIVE) Update page alloc function

2014-10-15 Thread Hui Zhu
If page alloc function __rmqueue try to get pages from MIGRATE_MOVABLE and conditions (cma_alloc_counter, cma_aggressive_free_min, cma_alloc_counter) allow, MIGRATE_CMA will be allocated as MIGRATE_MOVABLE first. Signed-off-by: Hui Zhu zhu...@xiaomi.com --- mm/page_alloc.c | 42

[PATCH 0/4] (CMA_AGGRESSIVE) Make CMA memory be more aggressive about allocation

2014-10-15 Thread Hui Zhu
In fallbacks of page_alloc.c, MIGRATE_CMA is the fallback of MIGRATE_MOVABLE. MIGRATE_MOVABLE will use MIGRATE_CMA when it doesn't have a page in order that Linux kernel want. If a system that has a lot of user space program is running, for instance, an Android board, most of memory is in

[PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task

2014-09-22 Thread Hui Zhu
-off-by: Hui Zhu --- drivers/staging/android/lowmemorykiller.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index b545d3d..ca1ffac 100644 --- a/drivers/staging/android/lowmemorykiller.c +++ b/drivers

[PATCH] Fix the issue that lowmemkiller fell into a cycle that try to kill a task

2014-09-22 Thread Hui Zhu
-off-by: Hui Zhu zhu...@xiaomi.com --- drivers/staging/android/lowmemorykiller.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c index b545d3d..ca1ffac 100644 --- a/drivers/staging/android/lowmemorykiller.c

Re: [PATCH v2] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-06-12 Thread Hui Zhu
Ping. Thanks, Hui On Mon, May 5, 2014 at 8:00 PM, Hui Zhu wrote: > cat gdb.base/interrupt.c > #include > #include > #include > #include > > #ifdef SIGNALS > #include > > static void > sigint_handler (int signo) > { > } > #endif > > int &g

Re: [PATCH v2] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-06-12 Thread Hui Zhu
Ping. Thanks, Hui On Mon, May 5, 2014 at 8:00 PM, Hui Zhu h...@codesourcery.com wrote: cat gdb.base/interrupt.c #include errno.h #include stdio.h #include unistd.h #include stdlib.h #ifdef SIGNALS #include signal.h static void sigint_handler (int signo) { } #endif int main

KGTP (dynamic tracer for Linux kernel and applications) 20140510 release (add quick start script kgtp.py)

2014-05-11 Thread Hui Zhu
KGTP (http://teawater.github.io/kgtp/) is a comprehensive dynamic tracer for analysing Linux kernel and application (including Android) problems on production systems in real time. I think people use KGTP first trouble is to configure complex. So the main change of this version is add a script

KGTP (dynamic tracer for Linux kernel and applications) 20140510 release (add quick start script kgtp.py)

2014-05-11 Thread Hui Zhu
KGTP (http://teawater.github.io/kgtp/) is a comprehensive dynamic tracer for analysing Linux kernel and application (including Android) problems on production systems in real time. I think people use KGTP first trouble is to configure complex. So the main change of this version is add a script

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-30 Thread Hui Zhu
On 05/01/14 00:28, Hui Zhu wrote: On Wed, Apr 30, 2014 at 9:35 PM, Mark Kettenis wrote: >>> Date: Tue, 29 Apr 2014 22:10:15 -0700 >>> From: "H. Peter Anvin" >>> >>> On 04/29/2014 10:08 PM, Andrew Pinski wrote: >>>> >>>

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-30 Thread Hui Zhu
xtension in arch/x86/asm/syscall.h:syscall_get_error(), > we could work around to problem in GDB by checking "orig_ax" to see if > we're continuing an interrupted system call and sign extend the error > code in the real "eax" register if we are. I will update patch in http

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-30 Thread Hui Zhu
register if we are. I will update patch in https://sourceware.org/ml/gdb-patches/2014-04/msg00429.html according to this comments. Thanks, Hui Signed-off-by: Hui Zhu h...@codesourcery.com --- --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c @@ -452,6 +452,23 @@ static int putreg

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-30 Thread Hui Zhu
On 05/01/14 00:28, Hui Zhu wrote: On Wed, Apr 30, 2014 at 9:35 PM, Mark Kettenis mark.kette...@xs4all.nl wrote: Date: Tue, 29 Apr 2014 22:10:15 -0700 From: H. Peter Anvin h...@zytor.com On 04/29/2014 10:08 PM, Andrew Pinski wrote: restoring the values is hard since even the ptrace

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-29 Thread Hui Zhu
On Tue, Apr 22, 2014 at 12:33 AM, H. Peter Anvin wrote: > On 04/21/2014 09:19 AM, Hui Zhu wrote: >> } >> Now ax is in 32 bits now, need sign-extend to 64 bits. But >> current_thread_info()->status TS_COMPAT is cleared when GDB call "call >> func1()". >

Re: [PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-29 Thread Hui Zhu
On Tue, Apr 22, 2014 at 12:33 AM, H. Peter Anvin h...@zytor.com wrote: On 04/21/2014 09:19 AM, Hui Zhu wrote: } Now ax is in 32 bits now, need sign-extend to 64 bits. But current_thread_info()-status TS_COMPAT is cleared when GDB call call func1(). Linux kernel don't know this is a 32 bits

Call for Topics and Sponsors -- Workshop on Open Source Development Tools 2014 (i.e. HelloGCC Workshop)

2014-04-24 Thread Hui Zhu
* Call for Topics and Sponsors Workshop on Open Source Development Tools 2014 (i.e. HelloGCC Workshop) Beijing, China Sep. 13rd, 2014 (TBD) HelloGCC Work Group (www.hellogcc.org)

Call for Topics and Sponsors -- Workshop on Open Source Development Tools 2014 (i.e. HelloGCC Workshop)

2014-04-24 Thread Hui Zhu
* Call for Topics and Sponsors Workshop on Open Source Development Tools 2014 (i.e. HelloGCC Workshop) Beijing, China Sep. 13rd, 2014 (TBD) HelloGCC Work Group (www.hellogcc.org)

[PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-21 Thread Hui Zhu
a errno in ERESTARTSYS. To fix this issue, I tried to add a local variable to "do_signal" but it is not works. The stack is cleared before GDB "continue". so I make a patch that add "test_thread_flag (TIF_IA32)" to syscall_get_error. Signed-off-by: H

[PATCH] Fix get ERESTARTSYS with m32 in x86_64 when debug by GDB

2014-04-21 Thread Hui Zhu
but it is not works. The stack is cleared before GDB continue. so I make a patch that add test_thread_flag (TIF_IA32) to syscall_get_error. Signed-off-by: Hui Zhu h...@codesourcery.com --- --- a/arch/x86/include/asm/syscall.h +++ b/arch/x86/include/asm/syscall.h @@ -48,7 +48,8 @@ static inline long

[PATCH 2/2] tool and script help GDB load Linux kernel modules (script)

2013-12-21 Thread Hui Zhu
t the data of module list, this script is slower than getmod. Signed-off-by: Hui Zhu --- --- /dev/null +++ b/scripts/getmod.py @@ -0,0 +1,151 @@ +#!/usr/bin/python + +# This script is used by GDB to load the symbols from Linux kernel modules +# Copyright(C) KGTP team (https://kgtp.googlecode.com),

[PATCH 1/2] tool and script help GDB load Linux kernel modules (tool)

2013-12-21 Thread Hui Zhu
tory. -hDisplay this information. Signed-off-by: Hui Zhu --- --- a/tools/Makefile +++ b/tools/Makefile @@ -16,6 +16,7 @@ help: @echo ' vm - misc vm tools' @echo ' x86_energy_perf_policy - Intel energy policy tool' @echo ' tmon - thermal monitoring and t

[PATCH 1/2] tool and script help GDB load Linux kernel modules (tool)

2013-12-21 Thread Hui Zhu
Display this information. Signed-off-by: Hui Zhu teawa...@gmail.com --- --- a/tools/Makefile +++ b/tools/Makefile @@ -16,6 +16,7 @@ help: @echo ' vm - misc vm tools' @echo ' x86_energy_perf_policy - Intel energy policy tool' @echo ' tmon - thermal monitoring

<    1   2   3   >