All of lore.kernel.org
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: fix bug which VMALLOC_START is lowwer than 0xf0000000
Date: Thu, 03 Sep 2015 10:34:32 +0200	[thread overview]
Message-ID: <1441269272.3102.3.camel@pengutronix.de> (raw)
In-Reply-To: <1441268887-11618-1-git-send-email-ytk.lee@samsung.com>

Am Donnerstag, den 03.09.2015, 17:28 +0900 schrieb Yongtaek Lee:
> > On Thu, Sep 03, 2015 at 11:24:47AM +0900, Yongtaek Lee wrote:
> > > default value of vmalloc_min was set 0xf0000000 for ARM by commit
> > > 0536bdf3. But actually vmalloc_min is 0xef800000 not 0xf0000000.
> > > 
> > > VMALLOC_END - (240 << 20) - VMALLOC_OFFSET)
> > > 0xff000000 - 0x0f000000 - 0x00800000 = 0xef800000
> > > 
> > > In case of 768MB ram without CONFIG_HIGHMEM=y, last 8MB could not be
> > > allocated. Kernel log also print out warning message as below.
> > > "Truncating RAM at 80000000-afffffff to -af7fffff (vmalloc region overlap)."
> > > 
> > > Although it could be solved by state "vmalloc=size" in cmdline but i think
> > > it would be better to change default value to 232 from 240.
> > > 
> > > Signed-off-by: Yongtaek Lee <ytk.lee@samsung.com>
> >
> > I fail to see what the problem is here.  You're adjusting the size of the
> > vmalloc space to accomodate the size of RAM you have.  That's not a bug.
> 
> I will explain more about problem. 
> It could happened with 768MB RAM device and CONFIG_HIGHMEN is not set.
> "vmalloc=size" also not stated so that default value of vmalloc_min will be 
> used to calculate lowmem end address. 

> before applying patch.
> [    0.000000]  [0:        swapper:    0] [c0] Truncating RAM at 80000000-afffffff to -af7fffff (vmalloc region overlap).
> 
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 106MB 652MB = 758MB total
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 669892k/669892k available, 108348k reserved, 0K highmem
> [    0.000000]  [0:        swapper:    0] [c0] Virtual kernel memory layout:
> [    0.000000]  [0:        swapper:    0]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
> [    0.000000]  [0:        swapper:    0]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
> [    0.000000]  [0:        swapper:    0]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
> [    0.000000]  [0:        swapper:    0]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
> [    0.000000]  [0:        swapper:    0]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
> [    0.000000]  [0:        swapper:    0]       .text : 0xc0008000 - 0xc09bbee0   (9936 kB)
> [    0.000000]  [0:        swapper:    0]       .init : 0xc09bc000 - 0xc0a2b740   ( 446 kB)
> [    0.000000]  [0:        swapper:    0]       .data : 0xc0a2c000 - 0xc0ac4088   ( 609 kB)
> [    0.000000]  [0:        swapper:    0]        .bss : 0xc0ac4088 - 0xc0d3e7b4   (2538 kB)
> 
> after applying patch. 
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 106MB 660MB = 766MB total
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 678004k/678004k available, 108428k reserved, 0K highmem
> [    0.000000]  [0:        swapper:    0] [c0] Virtual kernel memory layout:
> [    0.000000]  [0:        swapper:    0]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
> [    0.000000]  [0:        swapper:    0]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
> [    0.000000]  [0:        swapper:    0]     vmalloc : 0xf0800000 - 0xff000000   ( 232 MB)
> [    0.000000]  [0:        swapper:    0]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
> [    0.000000]  [0:        swapper:    0]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
> [    0.000000]  [0:        swapper:    0]       .text : 0xc0008000 - 0xc09bbee0   (9936 kB)
> [    0.000000]  [0:        swapper:    0]       .init : 0xc09bc000 - 0xc0a2b740   ( 446 kB)
> [    0.000000]  [0:        swapper:    0]       .data : 0xc0a2c000 - 0xc0ac4088   ( 609 kB)
> [    0.000000]  [0:        swapper:    0]        .bss : 0xc0ac4088 - 0xc0d3e7b4   (2538 kB)
> 
> As i know "vmalloc=size" is not mandatory so that i think default value of
> vmalloc_min is wrong. 
> 
So, if we go and apply your logic to a 1GB system we should resize the
vmalloc area to 0 bytes in order to avoid RAM truncation without
CONFIG_HIGHMEM?

Sorry, but the only sane options here are to either live with the
truncation, enable CONFIG_HIGHMEM, or set vmalloc size manually.
Changing a default value that affects everyone for the benefit of your
specific use-case isn't a sane option.

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

WARNING: multiple messages have this Message-ID (diff)
From: Lucas Stach <l.stach@pengutronix.de>
To: Yongtaek Lee <ytk.lee@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Nicolas Pitre <nicolas.pitre@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: Re: [PATCH] ARM: fix bug which VMALLOC_START is lowwer than 0xf0000000
Date: Thu, 03 Sep 2015 10:34:32 +0200	[thread overview]
Message-ID: <1441269272.3102.3.camel@pengutronix.de> (raw)
In-Reply-To: <1441268887-11618-1-git-send-email-ytk.lee@samsung.com>

Am Donnerstag, den 03.09.2015, 17:28 +0900 schrieb Yongtaek Lee:
> > On Thu, Sep 03, 2015 at 11:24:47AM +0900, Yongtaek Lee wrote:
> > > default value of vmalloc_min was set 0xf0000000 for ARM by commit
> > > 0536bdf3. But actually vmalloc_min is 0xef800000 not 0xf0000000.
> > > 
> > > VMALLOC_END - (240 << 20) - VMALLOC_OFFSET)
> > > 0xff000000 - 0x0f000000 - 0x00800000 = 0xef800000
> > > 
> > > In case of 768MB ram without CONFIG_HIGHMEM=y, last 8MB could not be
> > > allocated. Kernel log also print out warning message as below.
> > > "Truncating RAM at 80000000-afffffff to -af7fffff (vmalloc region overlap)."
> > > 
> > > Although it could be solved by state "vmalloc=size" in cmdline but i think
> > > it would be better to change default value to 232 from 240.
> > > 
> > > Signed-off-by: Yongtaek Lee <ytk.lee@samsung.com>
> >
> > I fail to see what the problem is here.  You're adjusting the size of the
> > vmalloc space to accomodate the size of RAM you have.  That's not a bug.
> 
> I will explain more about problem. 
> It could happened with 768MB RAM device and CONFIG_HIGHMEN is not set.
> "vmalloc=size" also not stated so that default value of vmalloc_min will be 
> used to calculate lowmem end address. 

> before applying patch.
> [    0.000000]  [0:        swapper:    0] [c0] Truncating RAM at 80000000-afffffff to -af7fffff (vmalloc region overlap).
> 
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 106MB 652MB = 758MB total
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 669892k/669892k available, 108348k reserved, 0K highmem
> [    0.000000]  [0:        swapper:    0] [c0] Virtual kernel memory layout:
> [    0.000000]  [0:        swapper:    0]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
> [    0.000000]  [0:        swapper:    0]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
> [    0.000000]  [0:        swapper:    0]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
> [    0.000000]  [0:        swapper:    0]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
> [    0.000000]  [0:        swapper:    0]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
> [    0.000000]  [0:        swapper:    0]       .text : 0xc0008000 - 0xc09bbee0   (9936 kB)
> [    0.000000]  [0:        swapper:    0]       .init : 0xc09bc000 - 0xc0a2b740   ( 446 kB)
> [    0.000000]  [0:        swapper:    0]       .data : 0xc0a2c000 - 0xc0ac4088   ( 609 kB)
> [    0.000000]  [0:        swapper:    0]        .bss : 0xc0ac4088 - 0xc0d3e7b4   (2538 kB)
> 
> after applying patch. 
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 106MB 660MB = 766MB total
> [    0.000000]  [0:        swapper:    0] [c0] Memory: 678004k/678004k available, 108428k reserved, 0K highmem
> [    0.000000]  [0:        swapper:    0] [c0] Virtual kernel memory layout:
> [    0.000000]  [0:        swapper:    0]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
> [    0.000000]  [0:        swapper:    0]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
> [    0.000000]  [0:        swapper:    0]     vmalloc : 0xf0800000 - 0xff000000   ( 232 MB)
> [    0.000000]  [0:        swapper:    0]     lowmem  : 0xc0000000 - 0xf0000000   ( 768 MB)
> [    0.000000]  [0:        swapper:    0]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
> [    0.000000]  [0:        swapper:    0]       .text : 0xc0008000 - 0xc09bbee0   (9936 kB)
> [    0.000000]  [0:        swapper:    0]       .init : 0xc09bc000 - 0xc0a2b740   ( 446 kB)
> [    0.000000]  [0:        swapper:    0]       .data : 0xc0a2c000 - 0xc0ac4088   ( 609 kB)
> [    0.000000]  [0:        swapper:    0]        .bss : 0xc0ac4088 - 0xc0d3e7b4   (2538 kB)
> 
> As i know "vmalloc=size" is not mandatory so that i think default value of
> vmalloc_min is wrong. 
> 
So, if we go and apply your logic to a 1GB system we should resize the
vmalloc area to 0 bytes in order to avoid RAM truncation without
CONFIG_HIGHMEM?

Sorry, but the only sane options here are to either live with the
truncation, enable CONFIG_HIGHMEM, or set vmalloc size manually.
Changing a default value that affects everyone for the benefit of your
specific use-case isn't a sane option.

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


  reply	other threads:[~2015-09-03  8:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03  2:24 [PATCH] ARM: fix bug which VMALLOC_START is lowwer than 0xf0000000 Yongtaek Lee
2015-09-03  2:24 ` Yongtaek Lee
2015-09-03  5:11 ` [PATCH] ARM: fix bug which lowmem size is limited to 760MB Yongtaek Lee
2015-09-03  5:11   ` Yongtaek Lee
2015-09-03  8:00 ` [PATCH] ARM: fix bug which VMALLOC_START is lowwer than 0xf0000000 Russell King - ARM Linux
2015-09-03  8:00   ` Russell King - ARM Linux
2015-09-03  8:28   ` Yongtaek Lee
2015-09-03  8:28     ` Yongtaek Lee
2015-09-03  8:34     ` Lucas Stach [this message]
2015-09-03  8:34       ` Lucas Stach
2015-09-03  8:43       ` Yongtaek Lee
2015-09-03  8:43         ` Re: " Yongtaek Lee
2015-09-03  9:10         ` Russell King - ARM Linux
2015-09-03  9:10           ` Re: " Russell King - ARM Linux
2015-09-03 10:30           ` [PATCH] ARM: fix bug which lowmem size is limited to 760MB Yongtaek Lee
2015-09-03 10:30             ` Yongtaek Lee
2015-09-04  1:24             ` Nicolas Pitre
2015-09-04  1:24               ` Nicolas Pitre
2015-09-07 11:41               ` Arnd Bergmann
2015-09-07 11:41                 ` Arnd Bergmann
2015-09-07 15:34                 ` Nicolas Pitre
2015-09-07 15:34                   ` Nicolas Pitre
2015-09-07 15:45                   ` Arnd Bergmann
2015-09-07 15:45                     ` Arnd Bergmann
2015-09-07 15:49                     ` Nicolas Pitre
2015-09-07 15:49                       ` Nicolas Pitre
2015-09-07 19:40                 ` Nicolas Pitre
2015-09-07 19:40                   ` Nicolas Pitre
2015-09-08  0:10                   ` Russell King - ARM Linux
2015-09-08  0:10                     ` Russell King - ARM Linux
2015-09-08  2:01                     ` Nicolas Pitre
2015-09-08  2:01                       ` Nicolas Pitre
2015-09-08  8:03                       ` Russell King - ARM Linux
2015-09-08  8:03                         ` Russell King - ARM Linux
2015-09-08 14:58                         ` Nicolas Pitre
2015-09-08 14:58                           ` Nicolas Pitre
2015-09-03  9:07       ` [PATCH] ARM: fix bug which VMALLOC_START is lowwer than 0xf0000000 Russell King - ARM Linux
2015-09-03  9:07         ` Russell King - ARM Linux

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=1441269272.3102.3.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.