All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: PINTU KUMAR <pintu_agarwal@yahoo.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linaro-mm-sig@lists.linaro.org" <linaro-mm-sig@lists.linaro.org>
Cc: "pintu.k@outlook.com" <pintu.k@outlook.com>,
	"pintu.k@samsung.com" <pintu.k@samsung.com>,
	"vishu_1385@yahoo.com" <vishu_1385@yahoo.com>,
	"mina86@mina86.com" <mina86@mina86.com>,
	"ngupta@vflare.org" <ngupta@vflare.org>,
	"iqbalblr@gmail.com" <iqbalblr@gmail.com>
Subject: Re: [linux-3.10.17] Could not allocate memory from free CMA areas
Date: Tue, 15 Jul 2014 14:49:20 +0200	[thread overview]
Message-ID: <53C52350.6020109@samsung.com> (raw)
In-Reply-To: <1404862900.76779.YahooMailNeo@web160102.mail.bf1.yahoo.com>

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>

WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-3.10.17] Could not allocate memory from free CMA areas
Date: Tue, 15 Jul 2014 14:49:20 +0200	[thread overview]
Message-ID: <53C52350.6020109@samsung.com> (raw)
In-Reply-To: <1404862900.76779.YahooMailNeo@web160102.mail.bf1.yahoo.com>

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

  parent reply	other threads:[~2014-07-15 12:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 23:41 [linux-3.10.17] Could not allocate memory from free CMA areas 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 [this message]
2014-07-15 12:49   ` Marek Szyprowski
2014-07-24 15:15 pintu_agarwal
2014-07-29  8:06 ` Joonsoo Kim
2014-07-29  8:06   ` Joonsoo Kim
2014-08-03 15:24 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C52350.6020109@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=iqbalblr@gmail.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=mina86@mina86.com \
    --cc=ngupta@vflare.org \
    --cc=pintu.k@outlook.com \
    --cc=pintu.k@samsung.com \
    --cc=pintu_agarwal@yahoo.com \
    --cc=vishu_1385@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.