linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Xu, Yanfei" <yanfei.xu@windriver.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: rppt@kernel.org, ardb@kernel.org, linus.walleij@linaro.org,
	akpm@linux-foundation.org, carver4lio@163.com,
	tiantao6@hisilicon.com, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Date: Wed, 19 May 2021 13:25:18 +0800	[thread overview]
Message-ID: <34802b34-ad4e-7e9a-f208-a9171eddaf32@windriver.com> (raw)
In-Reply-To: <E1liyda-0005B4-Kk@rmk-PC.armlinux.org.uk>



On 5/18/21 8:15 PM, Russell King (Oracle) wrote:
> [Please note: This e-mail is from an EXTERNAL e-mail address]
> 
> Change the current vmalloc_min, which is supposed to be the lowest
> address of vmalloc space including the VMALLOC_OFFSET, to vmalloc_start
> which does not include VMALLOC_OFFSET.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>   arch/arm/mm/mmu.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
> index d932c46a02e0..457203b41ceb 100644
> --- a/arch/arm/mm/mmu.c
> +++ b/arch/arm/mm/mmu.c
> @@ -1123,8 +1123,7 @@ void __init debug_ll_io_init(void)
>   }
>   #endif
> 
> -static unsigned long __initdata vmalloc_min =
> -       VMALLOC_END - (240 << 20) - VMALLOC_OFFSET;
> +static unsigned long __initdata vmalloc_start = VMALLOC_END - (240 << 20);
> 
>   /*
>    * vmalloc=size forces the vmalloc area to be exactly 'size'
> @@ -1142,14 +1141,14 @@ static int __init early_vmalloc(char *arg)
>                          vmalloc_reserve >> 20);
>          }
> 
> -       vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M);
> +       vmalloc_max = VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET);
>          if (vmalloc_reserve > vmalloc_max) {
>                  vmalloc_reserve = vmalloc_max;
>                  pr_warn("vmalloc area is too big, limiting to %luMB\n",
>                          vmalloc_reserve >> 20);
>          }
> 
> -       vmalloc_min = VMALLOC_END - vmalloc_reserve;
> +       vmalloc_start = VMALLOC_END - vmalloc_reserve;
>          return 0;
>   }
>   early_param("vmalloc", early_vmalloc);

The minimal vamlloc size should reduce 8MB, to be same with the original 
vmalloc size.

@@ -1133,8 +1133,8 @@ static int __init early_vmalloc(char *arg)
         unsigned long vmalloc_reserve = memparse(arg, NULL);
         unsigned long vmalloc_max;

-       if (vmalloc_reserve < SZ_16M) {
-               vmalloc_reserve = SZ_16M;
+       if (vmalloc_reserve < SZ_8M) {
+               vmalloc_reserve = SZ_8M;
                 pr_warn("vmalloc area too small, limiting to %luMB\n",
                         vmalloc_reserve >> 20);
         }

Another point, the current size of "vmalloc=" will be align up with 8MB, 
should we align it down? The original is align down when we consider the 
vmalloc_offest in vmalloc size. If yes, we could do it like

index eb6173315291..1fc2696fadd2 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1133,8 +1133,9 @@ static int __init early_vmalloc(char *arg)
         unsigned long vmalloc_reserve = memparse(arg, NULL);
         unsigned long vmalloc_max;

-       if (vmalloc_reserve < SZ_16M) {
-               vmalloc_reserve = SZ_16M;
+       vmalloc_reserve = ALIGN_DOWN(vmalloc_reserve, SZ_8M);
+       if (vmalloc_reserve < SZ_8M) {
+               vmalloc_reserve = SZ_8M;
                 pr_warn("vmalloc area too small, limiting to %luMB\n",
                         vmalloc_reserve >> 20);
         }


Regards,
Yanfei


> @@ -1169,7 +1168,8 @@ void __init adjust_lowmem_bounds(void)
>           * and may itself be outside the valid range for which phys_addr_t
>           * and therefore __pa() is defined.
>           */
> -       vmalloc_limit = (u64)vmalloc_min - PAGE_OFFSET + PHYS_OFFSET;
> +       vmalloc_limit = (u64)vmalloc_start -
> +                       (PAGE_OFFSET + PHYS_OFFSET + VMALLOC_OFFSET);
> 
>          /*
>           * The first usable region must be PMD aligned. Mark its start
> --
> 2.20.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-05-19  5:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 11:12 [PATCH] arm: make the size of vmalloc in cmdline and meminfo uniform Yanfei Xu
2021-05-18 11:29 ` Russell King (Oracle)
2021-05-18 12:06   ` Russell King (Oracle)
2021-05-18 12:15     ` [PATCH 1/4] ARM: change vmalloc_min to be unsigned long Russell King (Oracle)
2021-05-18 22:09       ` Linus Walleij
2021-05-18 12:15     ` [PATCH 2/4] ARM: use a temporary variable to hold maximum vmalloc size Russell King (Oracle)
2021-05-18 22:11       ` Linus Walleij
2021-05-18 12:15     ` [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start Russell King (Oracle)
2021-05-18 22:19       ` Linus Walleij
2021-05-18 22:26         ` Nicolas Pitre
2021-05-18 22:32           ` Nicolas Pitre
2021-05-18 22:34             ` Linus Walleij
2021-05-18 22:38               ` Nicolas Pitre
2021-05-28  9:55             ` Russell King (Oracle)
2021-05-19  4:41       ` Xu, Yanfei
2021-05-20  9:00         ` Russell King (Oracle)
2021-05-28  2:52           ` Xu, Yanfei
2021-05-28 10:00             ` Russell King (Oracle)
2021-05-19  5:25       ` Xu, Yanfei [this message]
2021-05-18 12:15     ` [PATCH 4/4] ARM: change vmalloc_start to vmalloc_size Russell King (Oracle)
2021-05-18 22:21       ` Linus Walleij
2021-05-19  4:39     ` [PATCH] arm: make the size of vmalloc in cmdline and meminfo uniform Xu, Yanfei
2021-05-19  5:32       ` Xu, Yanfei
2021-05-20  4:52         ` Alexander Dahl
2021-05-20  6:50           ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 1/6] ARM: change vmalloc_min to be unsigned long Russell King (Oracle)
2021-05-28 13:10       ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 2/6] ARM: use a temporary variable to hold maximum vmalloc size Russell King (Oracle)
2021-05-28 13:11       ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 3/6] ARM: change vmalloc_min to vmalloc_start Russell King (Oracle)
2021-05-28 12:21       ` Linus Walleij
2021-05-28 13:05       ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 4/6] ARM: change vmalloc_start to vmalloc_size Russell King (Oracle)
2021-05-28 12:22       ` Linus Walleij
2021-05-28 13:15       ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 5/6] ARM: use "* SZ_1M" rather than "<< 20" Russell King (Oracle)
2021-05-28 12:23       ` Linus Walleij
2021-05-28 13:17       ` Xu, Yanfei
2021-05-28 10:11     ` [PATCH v2 6/6] ARM: use MiB for vmalloc sizes Russell King (Oracle)
2021-05-28 12:24       ` Linus Walleij
2021-05-28 13:20       ` Xu, Yanfei

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=34802b34-ad4e-7e9a-f208-a9171eddaf32@windriver.com \
    --to=yanfei.xu@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=carver4lio@163.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=rppt@kernel.org \
    --cc=tiantao6@hisilicon.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).