All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc
@ 2016-01-12 11:14 Chen Feng
  2016-01-12 17:04 ` Laura Abbott
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Feng @ 2016-01-12 11:14 UTC (permalink / raw)
  To: gregkh, arve, riandrews, broonie, robh+dt, haojian.zhuang,
	puck.chen, yudongbin, saberlily.xia, suzhuangluan,
	kong.kongxinwei, xuyiping, z.liuxinliang, weidong2, w.f,
	puck.chen, shimingxing, oliver.fu, albert.lubing, chenxiang9,
	liuzixing, devel, linux-kernel
  Cc: qijiwen, peter.panshilin, dan.zhao, linuxarm, dev

Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.

With 3.5GB DMA Zone and 0.5 Normal Zone.

pgsteal_kswapd_dma 9364140
pgsteal_kswapd_normal 7071043
pgscan_kswapd_dma 10428250
pgscan_kswapd_normal 37840094

With this change the reclaim ratio has greatly improved
18.9% -> 72.5%

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Lu bing <albert.lubing@hisilicon.com>
---
 drivers/staging/android/ion/ion_system_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index d4c3e55..b69dfc7 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -27,7 +27,7 @@
 #include "ion_priv.h"
 
 static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
-				     __GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM;
+				     __GFP_NORETRY) & ~__GFP_RECLAIM;
 static gfp_t low_order_gfp_flags  = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
 static const unsigned int orders[] = {8, 4, 0};
 static const int num_orders = ARRAY_SIZE(orders);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc
  2016-01-12 11:14 [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc Chen Feng
@ 2016-01-12 17:04 ` Laura Abbott
  0 siblings, 0 replies; 3+ messages in thread
From: Laura Abbott @ 2016-01-12 17:04 UTC (permalink / raw)
  To: Chen Feng, gregkh, arve, riandrews, broonie, robh+dt,
	haojian.zhuang, yudongbin, saberlily.xia, suzhuangluan,
	kong.kongxinwei, xuyiping, z.liuxinliang, weidong2, w.f,
	puck.chen, shimingxing, oliver.fu, albert.lubing, chenxiang9,
	liuzixing, devel, linux-kernel
  Cc: qijiwen, peter.panshilin, dan.zhao, linuxarm, dev

On 01/12/2016 03:14 AM, Chen Feng wrote:
> Since ion alloc can be called by userspace,eg gralloc.
> When it is called frequently, the efficiency of kswapd is
> to low. And the reclaimed memory is too lower. In this way,
> the kswapd can use to much cpu resources.
>
> With 3.5GB DMA Zone and 0.5 Normal Zone.
>
> pgsteal_kswapd_dma 9364140
> pgsteal_kswapd_normal 7071043
> pgscan_kswapd_dma 10428250
> pgscan_kswapd_normal 37840094
>
> With this change the reclaim ratio has greatly improved
> 18.9% -> 72.5%
>
> Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
> Signed-off-by: Lu bing <albert.lubing@hisilicon.com>
> ---
>   drivers/staging/android/ion/ion_system_heap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
> index d4c3e55..b69dfc7 100644
> --- a/drivers/staging/android/ion/ion_system_heap.c
> +++ b/drivers/staging/android/ion/ion_system_heap.c
> @@ -27,7 +27,7 @@
>   #include "ion_priv.h"
>
>   static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
> -				     __GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM;
> +				     __GFP_NORETRY) & ~__GFP_RECLAIM;
>   static gfp_t low_order_gfp_flags  = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
>   static const unsigned int orders[] = {8, 4, 0};
>   static const int num_orders = ARRAY_SIZE(orders);
>

Makes sense given what the code is actually trying to do and the data presented
here.

Reviewed-by: Laura Abbott <labbott@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc
@ 2016-01-15  2:38 Chen Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Feng @ 2016-01-15  2:38 UTC (permalink / raw)
  To: gregkh, arve, riandrews, paul.gortmaker, labbott, gioh.kim,
	tranmanphong, mitchelh, devel, linux-kernel, puck.chen,
	yudongbin, saberlily.xia, suzhuangluan, kong.kongxinwei,
	xuyiping, z.liuxinliang, weidong2, w.f, puck.chen, shimingxing,
	oliver.fu, albert.lubing, chenxiang9, liuzixing, haojian.zhuang
  Cc: qijiwen, peter.panshilin, dan.zhao, linuxarm, dev

Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.

With 3.5GB DMA Zone and 0.5 Normal Zone.

pgsteal_kswapd_dma 9364140
pgsteal_kswapd_normal 7071043
pgscan_kswapd_dma 10428250
pgscan_kswapd_normal 37840094

With this change the reclaim ratio has greatly improved
18.9% -> 72.5%

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Lu bing <albert.lubing@hisilicon.com>
---
 drivers/staging/android/ion/ion_system_heap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c
index d4c3e55..b69dfc7 100644
--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -27,7 +27,7 @@
 #include "ion_priv.h"
 
 static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN |
-				     __GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM;
+				     __GFP_NORETRY) & ~__GFP_RECLAIM;
 static gfp_t low_order_gfp_flags  = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN);
 static const unsigned int orders[] = {8, 4, 0};
 static const int num_orders = ARRAY_SIZE(orders);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-01-15  2:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-12 11:14 [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc Chen Feng
2016-01-12 17:04 ` Laura Abbott
2016-01-15  2:38 Chen Feng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.