All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-08-03 15:24 pintu_agarwal
  2014-08-04  7:11   ` Joonsoo Kim
  0 siblings, 1 reply; 16+ messages in thread
From: pintu_agarwal @ 2014-08-03 15:24 UTC (permalink / raw)
  To: Joonsoo Kim, linux-mm, linux-arm-kernel, linaro-mm-sig, ritesh.list
  Cc: pintu.k, pintu.k, vishu_1385, m.szyprowski, mina86, ngupta, iqbalblr

[-- Attachment #1: Type: text/plain, Size: 2797 bytes --]

Dear Joonsoo,

I tried your changes which are present at the below link. 
https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
But unfortunately for me it did not help much. 
After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.
However I noticed the failure was little delayed. 
Also I noticed that the CMA utilized and the CMA free is not matching with total CMA size.

In my system RAM is 256MB and CMA configured is 56MB.
And free memory was hanging around 30-40MB during failure.

Am I missing something? 
My kernel version is 3.10 and I applied the changes manually. 
If there are other sets of patches that needs to be applied,  please let me know.
Note, I did not apply the ALLOC_CMA removal patches. 

Now I am experimenting more and will share if I have any findings.

Thank you!
Pintu

Sent from Samsung Mobile

-------- Original message --------
From: Joonsoo Kim <iamjoonsoo.kim@lge.com> 
Date: 29/07/2014  5:06 PM  (GMT+09:00) 
To: 'pintu_agarwal' <pintu_agarwal@yahoo.com>,linux-mm@kvack.org,linux-arm-kernel@lists.infradead.org,linaro-mm-sig@lists.linaro.org,ritesh.list@gmail.com 
Cc: pintu.k@outlook.com,pintu.k@samsung.com,vishu_1385@yahoo.com,m.szyprowski@samsung.com,mina86@mina86.com,ngupta@vflare.org,iqbalblr@gmail.com 
Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas 
 


From: pintu_agarwal [mailto:pintu_agarwal@yahoo.com] 
Sent: Friday, July 25, 2014 12:15 AM
To: PINTU KUMAR; linux-mm@kvack.org; linux-arm-kernel@lists.infradead.org; linaro-mm-sig@lists.linaro.org; iamjoonsoo.kim@lge.com; ritesh.list@gmail.com
Cc: pintu.k@outlook.com; pintu.k@samsung.com; vishu_1385@yahoo.com; m.szyprowski@samsung.com; mina86@mina86.com; ngupta@vflare.org; iqbalblr@gmail.com
Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas

Dear joonsoo kim,

> I have your patches for: Aggressively allocate memory from cma ....
> We are facing almost similar problem here.
> If any of your patches still working for you please let us know here.
> I would like to try those approach.


Hello,

I stopped to implement it, because there are other bugs on CMA related codes.
Although aggressively allocate... doesn't have bugs itself, it enlarges
existing freepage counting bugs significantly so I'm first trying to fix
those bugs. See the below link.

https://lkml.org/lkml/2014/7/4/79

I will restart to implement aggressively... after fixing these bugs.

If you have interest on next version of aggressively allocate..., see the
following link.

https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625

Thanks.



[-- Attachment #2: Type: text/html, Size: 3476 bytes --]

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

* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-08-03 15:24 [linux-3.10.17] Could not allocate memory from free CMA areas pintu_agarwal
@ 2014-08-04  7:11   ` Joonsoo Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-08-04  7:11 UTC (permalink / raw)
  To: 'pintu_agarwal',
	linux-mm, linux-arm-kernel, linaro-mm-sig, ritesh.list
  Cc: pintu.k, pintu.k, vishu_1385, m.szyprowski, mina86, ngupta, iqbalblr

> Dear Joonsoo,
> 
> I tried your changes which are present at the below link. 
> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
> But unfortunately for me it did not help much. 
> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.

Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.

> However I noticed the failure was little delayed.

It is good sign. I guess that there is movable/CMA ratio problem.
My patchset uses free CMA pages in certain ratio to free movable page consumption.
If your system doesn't use movable page sufficiently, free CMA pages cannot
be used fully. Could you test with following workaround?

+       if (normal > cma) {
+               zone->max_try_normal = pageblock_nr_pages;
+               zone->max_try_cma = pageblock_nr_pages;
+       } else {
+               zone->max_try_normal = pageblock_nr_pages;
+               zone->max_try_cma = pageblock_nr_pages;
+       }

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-08-04  7:11   ` Joonsoo Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-08-04  7:11 UTC (permalink / raw)
  To: linux-arm-kernel

> Dear Joonsoo,
> 
> I tried your changes which are present at the below link. 
> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
> But unfortunately for me it did not help much. 
> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.

Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.

> However I noticed the failure was little delayed.

It is good sign. I guess that there is movable/CMA ratio problem.
My patchset uses free CMA pages in certain ratio to free movable page consumption.
If your system doesn't use movable page sufficiently, free CMA pages cannot
be used fully. Could you test with following workaround?

+       if (normal > cma) {
+               zone->max_try_normal = pageblock_nr_pages;
+               zone->max_try_cma = pageblock_nr_pages;
+       } else {
+               zone->max_try_normal = pageblock_nr_pages;
+               zone->max_try_cma = pageblock_nr_pages;
+       }

Thanks.

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

* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-08-04  7:11   ` Joonsoo Kim
@ 2014-08-05 14:54     ` Pintu Kumar
  -1 siblings, 0 replies; 16+ messages in thread
From: Pintu Kumar @ 2014-08-05 14:54 UTC (permalink / raw)
  To: Joonsoo Kim, PINTU KUMAR, linux-mm, linux-arm-kernel,
	linaro-mm-sig, ritesh.list, mgorman
  Cc: pintu.k, m.szyprowski, mina86, ngupta, iqbalblr, rohit.kr, vishnu.ps

Hello,

> From: iamjoonsoo.kim@lge.com
> To: pintu_agarwal@yahoo.com; linux-mm@kvack.org; linux-arm-kernel@lists.infradead.org; linaro-mm-sig@lists.linaro.org; ritesh.list@gmail.com
> CC: pintu.k@outlook.com; pintu.k@samsung.com; vishu_1385@yahoo.com; m.szyprowski@samsung.com; mina86@mina86.com; ngupta@vflare.org; iqbalblr@gmail.com
> Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas
> Date: Mon, 4 Aug 2014 16:11:00 +0900
> 
>> Dear Joonsoo,
>> 
>> I tried your changes which are present at the below link. 
>> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
>> But unfortunately for me it did not help much. 
>> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.
> 
> Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.
> 
>> However I noticed the failure was little delayed.
> 
> It is good sign. I guess that there is movable/CMA ratio problem.
> My patchset uses free CMA pages in certain ratio to free movable page consumption.
> If your system doesn't use movable page sufficiently, free CMA pages cannot
> be used fully. Could you test with following workaround?
> 
> +       if (normal> cma) {
> +               zone->max_try_normal = pageblock_nr_pages;
> +               zone->max_try_cma = pageblock_nr_pages;
> +       } else {
> +               zone->max_try_normal = pageblock_nr_pages;
> +               zone->max_try_cma = pageblock_nr_pages;
> +       }

I applied these changes but still the allocations are failing because there are no non-movable memory left in the system.
With the changes I noticed that nr_cma_free sometimes becomes almost zero.
But in our case Display/Xorg needs to have atleast 8MB of CMA (contiguous) memory of order-8 and order-4 type.
CMA:56MB is shared across display,camera,video etc.

I think the previous changes are slightly better.

My concern is that whether I am applying all you changes or missing some thing.
I saw that your kernel version is based on next-20140625 but my kernel version is 3.10.17.
And till now I applied only the below changes:
https://github.com/JoonsooKim/linux/commit/33a0416b3ac1cd7c88e6b35ee61b4a81a7a14afc 

But I haven't applied this:
https://github.com/JoonsooKim/linux/commit/166b4186d101b190cf50195d841e2189f2743649
(CMA: always treat free cma pages as non-free on watermark checking)
These changes have other dependencies which is not present in my kernel version.
Like inclusion of ALLOC_FAIR and area->nr_cma_free.
Please let me know if these changes are also important for "aggressive alloc changes..."

If possible please send me all the patches related to "aggressive cma.." so that I can conclude on my experiment.

Further I will share the experimental result from my side.


> 
> Thanks.
> 
 		 	   		  
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-08-05 14:54     ` Pintu Kumar
  0 siblings, 0 replies; 16+ messages in thread
From: Pintu Kumar @ 2014-08-05 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

> From: iamjoonsoo.kim at lge.com
> To: pintu_agarwal at yahoo.com; linux-mm at kvack.org; linux-arm-kernel at lists.infradead.org; linaro-mm-sig at lists.linaro.org; ritesh.list at gmail.com
> CC: pintu.k at outlook.com; pintu.k at samsung.com; vishu_1385 at yahoo.com; m.szyprowski at samsung.com; mina86 at mina86.com; ngupta at vflare.org; iqbalblr at gmail.com
> Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas
> Date: Mon, 4 Aug 2014 16:11:00 +0900
> 
>> Dear Joonsoo,
>> 
>> I tried your changes which are present at the below link. 
>> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
>> But unfortunately for me it did not help much. 
>> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.
> 
> Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.
> 
>> However I noticed the failure was little delayed.
> 
> It is good sign. I guess that there is movable/CMA ratio problem.
> My patchset uses free CMA pages in certain ratio to free movable page consumption.
> If your system doesn't use movable page sufficiently, free CMA pages cannot
> be used fully. Could you test with following workaround?
> 
> +       if (normal> cma) {
> +               zone->max_try_normal = pageblock_nr_pages;
> +               zone->max_try_cma = pageblock_nr_pages;
> +       } else {
> +               zone->max_try_normal = pageblock_nr_pages;
> +               zone->max_try_cma = pageblock_nr_pages;
> +       }

I applied these changes but still the allocations are failing because there are no non-movable memory left in the system.
With the changes I noticed that nr_cma_free sometimes becomes almost zero.
But in our case Display/Xorg needs to have atleast 8MB of CMA (contiguous) memory of order-8 and order-4 type.
CMA:56MB is shared across display,camera,video etc.

I think the previous changes are slightly better.

My concern is that whether I am applying all you changes or missing some thing.
I saw that your kernel version is based on next-20140625 but my kernel version is 3.10.17.
And till now I applied only the below changes:
https://github.com/JoonsooKim/linux/commit/33a0416b3ac1cd7c88e6b35ee61b4a81a7a14afc 

But I haven't applied this:
https://github.com/JoonsooKim/linux/commit/166b4186d101b190cf50195d841e2189f2743649
(CMA: always treat free cma pages as non-free on watermark checking)
These changes have other dependencies which is not present in my kernel version.
Like inclusion of ALLOC_FAIR and area->nr_cma_free.
Please let me know if these changes are also important for "aggressive alloc changes..."

If possible please send me all the patches related to "aggressive cma.." so that I can conclude on my experiment.

Further I will share the experimental result from my side.


> 
> Thanks.
> 
 		 	   		  

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

* Re: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-08-05 14:54     ` Pintu Kumar
@ 2014-08-06  7:59       ` Joonsoo Kim
  -1 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-08-06  7:59 UTC (permalink / raw)
  To: Pintu Kumar
  Cc: PINTU KUMAR, linux-mm, linux-arm-kernel, linaro-mm-sig,
	ritesh.list, mgorman, pintu.k, m.szyprowski, mina86, ngupta,
	iqbalblr, rohit.kr, vishnu.ps

On Tue, Aug 05, 2014 at 08:24:50PM +0530, Pintu Kumar wrote:
> Hello,
> 
> > From: iamjoonsoo.kim@lge.com
> > To: pintu_agarwal@yahoo.com; linux-mm@kvack.org; linux-arm-kernel@lists.infradead.org; linaro-mm-sig@lists.linaro.org; ritesh.list@gmail.com
> > CC: pintu.k@outlook.com; pintu.k@samsung.com; vishu_1385@yahoo.com; m.szyprowski@samsung.com; mina86@mina86.com; ngupta@vflare.org; iqbalblr@gmail.com
> > Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas
> > Date: Mon, 4 Aug 2014 16:11:00 +0900
> > 
> >> Dear Joonsoo,
> >> 
> >> I tried your changes which are present at the below link. 
> >> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
> >> But unfortunately for me it did not help much. 
> >> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.
> > 
> > Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.
> > 
> >> However I noticed the failure was little delayed.
> > 
> > It is good sign. I guess that there is movable/CMA ratio problem.
> > My patchset uses free CMA pages in certain ratio to free movable page consumption.
> > If your system doesn't use movable page sufficiently, free CMA pages cannot
> > be used fully. Could you test with following workaround?
> > 
> > +       if (normal> cma) {
> > +               zone->max_try_normal = pageblock_nr_pages;
> > +               zone->max_try_cma = pageblock_nr_pages;
> > +       } else {
> > +               zone->max_try_normal = pageblock_nr_pages;
> > +               zone->max_try_cma = pageblock_nr_pages;
> > +       }
> 
> I applied these changes but still the allocations are failing because there are no non-movable memory left in the system.

Hello,

kswapd doesn't work?
Please let me know your problem in detail.

> With the changes I noticed that nr_cma_free sometimes becomes almost zero.
> But in our case Display/Xorg needs to have atleast 8MB of CMA (contiguous) memory of order-8 and order-4 type.
> CMA:56MB is shared across display,camera,video etc.

Used CMA pages will be released automatically when your Display/Xorg
request them. So you don't need to worry about empty of free CMA pages.

> 
> I think the previous changes are slightly better.
> 
> My concern is that whether I am applying all you changes or missing some thing.
> I saw that your kernel version is based on next-20140625 but my kernel version is 3.10.17.
> And till now I applied only the below changes:
> https://github.com/JoonsooKim/linux/commit/33a0416b3ac1cd7c88e6b35ee61b4a81a7a14afc 
> 
> But I haven't applied this:
> https://github.com/JoonsooKim/linux/commit/166b4186d101b190cf50195d841e2189f2743649
> (CMA: always treat free cma pages as non-free on watermark checking)

This patch is somewhat related to your failure of non-movable memory
allocation. It is simple so that you can easily backport.

> These changes have other dependencies which is not present in my kernel version.
> Like inclusion of ALLOC_FAIR and area->nr_cma_free.
> Please let me know if these changes are also important for "aggressive alloc changes..."
> 
> If possible please send me all the patches related to "aggressive cma.." so that I can conclude on my experiment.

Until now, that's all. :)

Thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-08-06  7:59       ` Joonsoo Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-08-06  7:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 05, 2014 at 08:24:50PM +0530, Pintu Kumar wrote:
> Hello,
> 
> > From: iamjoonsoo.kim at lge.com
> > To: pintu_agarwal at yahoo.com; linux-mm at kvack.org; linux-arm-kernel at lists.infradead.org; linaro-mm-sig at lists.linaro.org; ritesh.list at gmail.com
> > CC: pintu.k at outlook.com; pintu.k at samsung.com; vishu_1385 at yahoo.com; m.szyprowski at samsung.com; mina86 at mina86.com; ngupta at vflare.org; iqbalblr at gmail.com
> > Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas
> > Date: Mon, 4 Aug 2014 16:11:00 +0900
> > 
> >> Dear Joonsoo,
> >> 
> >> I tried your changes which are present at the below link. 
> >> https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625
> >> But unfortunately for me it did not help much. 
> >> After running various apps that uses ION nonmovable memory, it fails to allocate memory after some time. When I see the pagetypeinfo shows lots of CMA pages available and non-movable were very less and thus nonmovable allocation were failing.
> > 
> > Okay. CMA pages cannot be used for nonmovable memory, so it can fail in above case.
> > 
> >> However I noticed the failure was little delayed.
> > 
> > It is good sign. I guess that there is movable/CMA ratio problem.
> > My patchset uses free CMA pages in certain ratio to free movable page consumption.
> > If your system doesn't use movable page sufficiently, free CMA pages cannot
> > be used fully. Could you test with following workaround?
> > 
> > +       if (normal> cma) {
> > +               zone->max_try_normal = pageblock_nr_pages;
> > +               zone->max_try_cma = pageblock_nr_pages;
> > +       } else {
> > +               zone->max_try_normal = pageblock_nr_pages;
> > +               zone->max_try_cma = pageblock_nr_pages;
> > +       }
> 
> I applied these changes but still the allocations are failing because there are no non-movable memory left in the system.

Hello,

kswapd doesn't work?
Please let me know your problem in detail.

> With the changes I noticed that nr_cma_free sometimes becomes almost zero.
> But in our case Display/Xorg needs to have atleast 8MB of CMA (contiguous) memory of order-8 and order-4 type.
> CMA:56MB is shared across display,camera,video etc.

Used CMA pages will be released automatically when your Display/Xorg
request them. So you don't need to worry about empty of free CMA pages.

> 
> I think the previous changes are slightly better.
> 
> My concern is that whether I am applying all you changes or missing some thing.
> I saw that your kernel version is based on next-20140625 but my kernel version is 3.10.17.
> And till now I applied only the below changes:
> https://github.com/JoonsooKim/linux/commit/33a0416b3ac1cd7c88e6b35ee61b4a81a7a14afc 
> 
> But I haven't applied this:
> https://github.com/JoonsooKim/linux/commit/166b4186d101b190cf50195d841e2189f2743649
> (CMA: always treat free cma pages as non-free on watermark checking)

This patch is somewhat related to your failure of non-movable memory
allocation. It is simple so that you can easily backport.

> These changes have other dependencies which is not present in my kernel version.
> Like inclusion of ALLOC_FAIR and area->nr_cma_free.
> Please let me know if these changes are also important for "aggressive alloc changes..."
> 
> If possible please send me all the patches related to "aggressive cma.." so that I can conclude on my experiment.

Until now, that's all. :)

Thanks.

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

* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-07-24 15:15 pintu_agarwal
@ 2014-07-29  8:06   ` Joonsoo Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-07-29  8:06 UTC (permalink / raw)
  To: 'pintu_agarwal',
	linux-mm, linux-arm-kernel, linaro-mm-sig, ritesh.list
  Cc: pintu.k, pintu.k, vishu_1385, m.szyprowski, mina86, ngupta, iqbalblr



From: pintu_agarwal [mailto:pintu_agarwal@yahoo.com] 
Sent: Friday, July 25, 2014 12:15 AM
To: PINTU KUMAR; linux-mm@kvack.org; linux-arm-kernel@lists.infradead.org; linaro-mm-sig@lists.linaro.org; iamjoonsoo.kim@lge.com; ritesh.list@gmail.com
Cc: pintu.k@outlook.com; pintu.k@samsung.com; vishu_1385@yahoo.com; m.szyprowski@samsung.com; mina86@mina86.com; ngupta@vflare.org; iqbalblr@gmail.com
Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas

Dear joonsoo kim,

> I have your patches for: Aggressively allocate memory from cma ....
> We are facing almost similar problem here.
> If any of your patches still working for you please let us know here.
> I would like to try those approach.


Hello,

I stopped to implement it, because there are other bugs on CMA related codes.
Although aggressively allocate... doesn't have bugs itself, it enlarges
existing freepage counting bugs significantly so I'm first trying to fix
those bugs. See the below link.

https://lkml.org/lkml/2014/7/4/79

I will restart to implement aggressively... after fixing these bugs.

If you have interest on next version of aggressively allocate..., see the
following link.

https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625

Thanks.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-29  8:06   ` Joonsoo Kim
  0 siblings, 0 replies; 16+ messages in thread
From: Joonsoo Kim @ 2014-07-29  8:06 UTC (permalink / raw)
  To: linux-arm-kernel



From: pintu_agarwal [mailto:pintu_agarwal at yahoo.com] 
Sent: Friday, July 25, 2014 12:15 AM
To: PINTU KUMAR; linux-mm at kvack.org; linux-arm-kernel at lists.infradead.org; linaro-mm-sig at lists.linaro.org; iamjoonsoo.kim at lge.com; ritesh.list at gmail.com
Cc: pintu.k at outlook.com; pintu.k at samsung.com; vishu_1385 at yahoo.com; m.szyprowski at samsung.com; mina86 at mina86.com; ngupta at vflare.org; iqbalblr at gmail.com
Subject: RE: [linux-3.10.17] Could not allocate memory from free CMA areas

Dear joonsoo kim,

> I have your patches for: Aggressively allocate memory from cma ....
> We are facing almost similar problem here.
> If any of your patches still working for you please let us know here.
> I would like to try those approach.


Hello,

I stopped to implement it, because there are other bugs on CMA related codes.
Although aggressively allocate... doesn't have bugs itself, it enlarges
existing freepage counting bugs significantly so I'm first trying to fix
those bugs. See the below link.

https://lkml.org/lkml/2014/7/4/79

I will restart to implement aggressively... after fixing these bugs.

If you have interest on next version of aggressively allocate..., see the
following link.

https://github.com/JoonsooKim/linux/tree/cma-fix-up-v3.0-next-20140625

Thanks.

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

* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-24 15:15 pintu_agarwal
  2014-07-29  8:06   ` Joonsoo Kim
  0 siblings, 1 reply; 16+ messages in thread
From: pintu_agarwal @ 2014-07-24 15:15 UTC (permalink / raw)
  To: PINTU KUMAR, linux-mm, linux-arm-kernel, linaro-mm-sig,
	iamjoonsoo.kim, ritesh.list
  Cc: pintu.k, pintu.k, vishu_1385, m.szyprowski, mina86, ngupta, iqbalblr

[-- Attachment #1: Type: text/plain, Size: 2607 bytes --]

Dear joonsoo kim,

I have your patches for: Aggressively allocate memory from cma ....
We are facing almost similar problem here.
If any of your patches still working for you please let us know here.
I would like to try those approach.

Thank you


Sent from Samsung Mobile

-------- Original message --------
From: PINTU KUMAR <pintu_agarwal@yahoo.com> 
Date: 09/07/2014  8:41 AM  (GMT+09:00) 
To: linux-mm@kvack.org,linux-mm@kvack.org,linux-arm-kernel@lists.infradead.org,linaro-mm-sig@lists.linaro.org 
Cc: pintu.k@outlook.com,pintu.k@samsung.com,vishu_1385@yahoo.com,m.szyprowski@samsung.com,mina86@mina86.com,ngupta@vflare.org,iqbalblr@gmail.com 
Subject: [linux-3.10.17] Could not allocate memory from free CMA areas 
 
Hi,

We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.

system details:
ARM embedded device: RAM: 256MB
Kernel version: 3.10.17
Fixed Reserved memory: ~40MB
Available memory: 217MB
CMA reserved 1 : 56MB
ZRAM configured: 128MB or 64MB
min_free_kbytes: 1625 (default)
Memory controller group enabled (MEMCG)


After boot-up the "free -tm" command shows free memory as: ~50MB
CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
Thus most of the free memory is in the form of CMA free memory.
ZRAM getting uses was around ~5MB.


During boot-up itself we observe that the following conditions are met.


if (free_pages - free_cma <= min + lowmem_reserve) {
    printk"[PINTU]: __zone_watermark_ok: failed !\n");

    return false;
}
Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0


Thus is condition is met most of the time.
And because of this watermark failure, Kswapd is waking up frequently.
The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.


We also observed that ZRAM is trying to allocate memory from CMA region and failing.

We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.

Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.

Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.


Please let us know if anybody have come across the same problem and how to resolve this issue.





Thank You!
Regards,
Pintu

[-- Attachment #2: Type: text/html, Size: 3117 bytes --]

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

* Re: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-07-08 23:41 ` PINTU KUMAR
@ 2014-07-15 12:49   ` Marek Szyprowski
  -1 siblings, 0 replies; 16+ messages in thread
From: Marek Szyprowski @ 2014-07-15 12:49 UTC (permalink / raw)
  To: PINTU KUMAR, linux-mm, linux-arm-kernel, linaro-mm-sig
  Cc: pintu.k, pintu.k, vishu_1385, mina86, ngupta, iqbalblr

Hello,

On 2014-07-09 01:41, PINTU KUMAR wrote:
> Hi,
>
> We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
> We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.
>
> system details:
> ARM embedded device: RAM: 256MB
> Kernel version: 3.10.17
> Fixed Reserved memory: ~40MB
> Available memory: 217MB
> CMA reserved 1 : 56MB
> ZRAM configured: 128MB or 64MB
> min_free_kbytes: 1625 (default)
> Memory controller group enabled (MEMCG)
>
>
> After boot-up the "free -tm" command shows free memory as: ~50MB
> CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
> Thus most of the free memory is in the form of CMA free memory.
> ZRAM getting uses was around ~5MB.
>
>
> During boot-up itself we observe that the following conditions are met.
>
>
> if (free_pages - free_cma <= min + lowmem_reserve) {
>      printk"[PINTU]: __zone_watermark_ok: failed !\n");
>
>      return false;
> }
> Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0
>
>
> Thus is condition is met most of the time.
> And because of this watermark failure, Kswapd is waking up frequently.
> The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.
>
>
> We also observed that ZRAM is trying to allocate memory from CMA region and failing.
>
> We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.
>
> Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.
>
> Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.
>
>
> Please let us know if anybody have come across the same problem and how to resolve this issue.

Frankly I really have no idea what is going on. ZRAM/zsmalloc should not 
try to alloc memory from CMA. I don't have access you the mentioned 
source code. What flags are passed to alloc_pages() in zram/zsmalloc? It 
should get pages from non-movable pool.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-15 12:49   ` Marek Szyprowski
  0 siblings, 0 replies; 16+ messages in thread
From: Marek Szyprowski @ 2014-07-15 12:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On 2014-07-09 01:41, PINTU KUMAR wrote:
> Hi,
>
> We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
> We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.
>
> system details:
> ARM embedded device: RAM: 256MB
> Kernel version: 3.10.17
> Fixed Reserved memory: ~40MB
> Available memory: 217MB
> CMA reserved 1 : 56MB
> ZRAM configured: 128MB or 64MB
> min_free_kbytes: 1625 (default)
> Memory controller group enabled (MEMCG)
>
>
> After boot-up the "free -tm" command shows free memory as: ~50MB
> CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
> Thus most of the free memory is in the form of CMA free memory.
> ZRAM getting uses was around ~5MB.
>
>
> During boot-up itself we observe that the following conditions are met.
>
>
> if (free_pages - free_cma <= min + lowmem_reserve) {
>      printk"[PINTU]: __zone_watermark_ok: failed !\n");
>
>      return false;
> }
> Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0
>
>
> Thus is condition is met most of the time.
> And because of this watermark failure, Kswapd is waking up frequently.
> The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.
>
>
> We also observed that ZRAM is trying to allocate memory from CMA region and failing.
>
> We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.
>
> Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.
>
> Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.
>
>
> Please let us know if anybody have come across the same problem and how to resolve this issue.

Frankly I really have no idea what is going on. ZRAM/zsmalloc should not 
try to alloc memory from CMA. I don't have access you the mentioned 
source code. What flags are passed to alloc_pages() in zram/zsmalloc? It 
should get pages from non-movable pool.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

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

* RE: [linux-3.10.17] Could not allocate memory from free CMA areas
  2014-07-08 23:41 ` PINTU KUMAR
@ 2014-07-12  1:27   ` Pintu Kumar
  -1 siblings, 0 replies; 16+ messages in thread
From: Pintu Kumar @ 2014-07-12  1:27 UTC (permalink / raw)
  To: PINTU KUMAR, linux-mm, linux-arm-kernel, linaro-mm-sig, lauraa,
	ngupta, minchan, mgorman
  Cc: pintu.k, vishu_1385, m.szyprowski, mina86, iqbalblr

Hi All,

No reply on the below.

Does anybody came across with the similar issues?
Please let me know if any fixes are already available.

Issues:
1) When free memory pages and CMA free pages are almost equal, min watermark check is failing, resulting in swapping.
2) Almost all the free memory in system is CMA free memory.
3) When ZRAM tries to allocate pages from CMA free areas, the allocation fails.

Please refer below for more details.



Thank you!
Regards,
Pintu



> Date: Tue, 8 Jul 2014 16:41:40 -0700
> From: pintu_agarwal@yahoo.com
> Subject: [linux-3.10.17] Could not allocate memory from free CMA areas
> To: linux-mm@kvack.org; linux-mm@kvack.org; linux-arm-kernel@lists.infradead.org; linaro-mm-sig@lists.linaro.org
> CC: pintu.k@outlook.com; pintu.k@samsung.com; vishu_1385@yahoo.com; m.szyprowski@samsung.com; mina86@mina86.com; ngupta@vflare.org; iqbalblr@gmail.com
> 
> Hi,
> 
> We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
> We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.
> 
> system details:
> ARM embedded device: RAM: 256MB
> Kernel version: 3.10.17
> Fixed Reserved memory: ~40MB
> Available memory: 217MB
> CMA reserved 1 : 56MB
> ZRAM configured: 128MB or 64MB
> min_free_kbytes: 1625 (default)
> Memory controller group enabled (MEMCG)
> 
> 
> After boot-up the "free -tm" command shows free memory as: ~50MB
> CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
> Thus most of the free memory is in the form of CMA free memory.
> ZRAM getting uses was around ~5MB.
> 
> 
> During boot-up itself we observe that the following conditions are met.
> 
> 
> if (free_pages - free_cma <= min + lowmem_reserve) {
>     printk"[PINTU]: __zone_watermark_ok: failed !\n");
> 
>     return false;
> }
> Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0
> 
> 
> Thus is condition is met most of the time.
> And because of this watermark failure, Kswapd is waking up frequently.
> The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.
> 
> 
> We also observed that ZRAM is trying to allocate memory from CMA region and failing.
> 
> We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.
> 
> Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.
> 
> Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.
> 
> 
> Please let us know if anybody have come across the same problem and how to resolve this issue.
> 
> 
> 
> 
> 
> Thank You!
> Regards,
> Pintu
 		 	   		  
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-12  1:27   ` Pintu Kumar
  0 siblings, 0 replies; 16+ messages in thread
From: Pintu Kumar @ 2014-07-12  1:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi All,

No reply on the below.

Does anybody came across with the similar issues?
Please let me know if any fixes are already available.

Issues:
1) When free memory pages and CMA free pages are almost equal, min watermark check is failing, resulting in swapping.
2) Almost all the free memory in system is CMA free memory.
3) When ZRAM tries to allocate pages from CMA free areas, the allocation fails.

Please refer below for more details.



Thank you!
Regards,
Pintu



> Date: Tue, 8 Jul 2014 16:41:40 -0700
> From: pintu_agarwal at yahoo.com
> Subject: [linux-3.10.17] Could not allocate memory from free CMA areas
> To: linux-mm at kvack.org; linux-mm at kvack.org; linux-arm-kernel at lists.infradead.org; linaro-mm-sig at lists.linaro.org
> CC: pintu.k at outlook.com; pintu.k at samsung.com; vishu_1385 at yahoo.com; m.szyprowski at samsung.com; mina86 at mina86.com; ngupta at vflare.org; iqbalblr at gmail.com
> 
> Hi,
> 
> We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
> We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.
> 
> system details:
> ARM embedded device: RAM: 256MB
> Kernel version: 3.10.17
> Fixed Reserved memory: ~40MB
> Available memory: 217MB
> CMA reserved 1 : 56MB
> ZRAM configured: 128MB or 64MB
> min_free_kbytes: 1625 (default)
> Memory controller group enabled (MEMCG)
> 
> 
> After boot-up the "free -tm" command shows free memory as: ~50MB
> CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
> Thus most of the free memory is in the form of CMA free memory.
> ZRAM getting uses was around ~5MB.
> 
> 
> During boot-up itself we observe that the following conditions are met.
> 
> 
> if (free_pages - free_cma <= min + lowmem_reserve) {
> ??? printk"[PINTU]: __zone_watermark_ok: failed !\n");
> 
> ??? return false;
> }
> Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0
> 
> 
> Thus is condition is met most of the time.
> And because of this watermark failure, Kswapd is waking up frequently.
> The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.
> 
> 
> We also observed that ZRAM is trying to allocate memory from CMA region and failing.
> 
> We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.
> 
> Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.
> 
> Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.
> 
> 
> Please let us know if anybody have come across the same problem and how to resolve this issue.
> 
> 
> 
> 
> 
> Thank You!
> Regards,
> Pintu
 		 	   		  

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-08 23:41 ` PINTU KUMAR
  0 siblings, 0 replies; 16+ messages in thread
From: PINTU KUMAR @ 2014-07-08 23:41 UTC (permalink / raw)
  To: linux-mm
  Cc: pintu.k, pintu.k, vishu_1385, m.szyprowski, mina86, ngupta, iqbalblr

Hi,

We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.

system details:
ARM embedded device: RAM: 256MB
Kernel version: 3.10.17
Fixed Reserved memory: ~40MB
Available memory: 217MB
CMA reserved 1 : 56MB
ZRAM configured: 128MB or 64MB
min_free_kbytes: 1625 (default)
Memory controller group enabled (MEMCG)


After boot-up the "free -tm" command shows free memory as: ~50MB
CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
Thus most of the free memory is in the form of CMA free memory.
ZRAM getting uses was around ~5MB.


During boot-up itself we observe that the following conditions are met.


if (free_pages - free_cma <= min + lowmem_reserve) {
    printk"[PINTU]: __zone_watermark_ok: failed !\n");

    return false;
}
Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0


Thus is condition is met most of the time.
And because of this watermark failure, Kswapd is waking up frequently.
The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.


We also observed that ZRAM is trying to allocate memory from CMA region and failing.

We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.

Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.

Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.


Please let us know if anybody have come across the same problem and how to resolve this issue.





Thank You!
Regards,
Pintu

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* [linux-3.10.17] Could not allocate memory from free CMA areas
@ 2014-07-08 23:41 ` PINTU KUMAR
  0 siblings, 0 replies; 16+ messages in thread
From: PINTU KUMAR @ 2014-07-08 23:41 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

We are facing one problem on linux 3.10 when we try to use CMA as large as 56MB for 256MB RAM device.
We found that after certain point of time (during boot), min watermark check is failing when "free_pages" and "free_cma_pages" are almost equal and falls below the min level.

system details:
ARM embedded device: RAM: 256MB
Kernel version: 3.10.17
Fixed Reserved memory: ~40MB
Available memory: 217MB
CMA reserved 1 : 56MB
ZRAM configured: 128MB or 64MB
min_free_kbytes: 1625 (default)
Memory controller group enabled (MEMCG)


After boot-up the "free -tm" command shows free memory as: ~50MB
CMA is used for all UI display purposes. CMA used during bootup is close to ~6MB.
Thus most of the free memory is in the form of CMA free memory.
ZRAM getting uses was around ~5MB.


During boot-up itself we observe that the following conditions are met.


if (free_pages - free_cma <= min + lowmem_reserve) {
??? printk"[PINTU]: __zone_watermark_ok: failed !\n");

??? return false;
}
Here: free_pages was: 12940, free_cma was: 12380, min: 566, lowmem: 0


Thus is condition is met most of the time.
And because of this watermark failure, Kswapd is waking up frequently.
The /proc/pagetypeinfo reports that most of the higher order pages are from CMA regions.


We also observed that ZRAM is trying to allocate memory from CMA region and failing.

We also tried by decreasing the CMA region to 20MB. With this the watermark failure is not happening in boot time. But if we launch more than 3 apps {Browser, music-player etc}, again the watermark started failing.

Also we tried decreasing the min_free_kbytes=256, and with this also watermark is passed.

Our observation is that ZRAM/zsmalloc trying to allocate memory from CMA areas and failed.


Please let us know if anybody have come across the same problem and how to resolve this issue.





Thank You!
Regards,
Pintu

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

end of thread, other threads:[~2014-08-06  7:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-03 15:24 [linux-3.10.17] Could not allocate memory from free CMA areas pintu_agarwal
2014-08-04  7:11 ` Joonsoo Kim
2014-08-04  7:11   ` Joonsoo Kim
2014-08-05 14:54   ` Pintu Kumar
2014-08-05 14:54     ` Pintu Kumar
2014-08-06  7:59     ` Joonsoo Kim
2014-08-06  7:59       ` Joonsoo Kim
  -- strict thread matches above, loose matches on Subject: below --
2014-07-24 15:15 pintu_agarwal
2014-07-29  8:06 ` Joonsoo Kim
2014-07-29  8:06   ` Joonsoo Kim
2014-07-08 23:41 PINTU KUMAR
2014-07-08 23:41 ` PINTU KUMAR
2014-07-12  1:27 ` Pintu Kumar
2014-07-12  1:27   ` Pintu Kumar
2014-07-15 12:49 ` Marek Szyprowski
2014-07-15 12:49   ` Marek Szyprowski

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.