arm: make the size of vmalloc in cmdline and meminfo uniform
PATCH 1/1 arm: make the size of vmalloc in cmdline and meminfo uniform
The value of "vmalloc=" set in cmdline is always 8M more than the value of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user expect to get the size what they input, and no need to consider the 8M "hole" hided in codes. This commit make real vmalloc size equal to value of "vmalloc=" in cmdline.
Also, the commit will reduce the size of vmalloc printed in boot message by 8M when the size set in cmdline is irrational.
--- arch/arm/mm/mmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/mm/mmu.c +5 -4
@@ -1133,19 +1133,20 @@ static int __init early_vmalloc(char *arg) {unsigned long vmalloc_reserve =memparse (arg,NULL ); -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 ); }if (vmalloc_reserve >VMALLOC_END - (PAGE_OFFSET +SZ_32M )) { - vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); + vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M +VMALLOC_OFFSET );pr_warn ("vmalloc area is too big, limiting to %luMB\n" , vmalloc_reserve >>20 ); } - vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve); + vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve -VMALLOC_OFFSET );return 0 ; }early_param ("vmalloc" , early_vmalloc);
Signature · 1 line
2.27.0
Russell King (Oracle)
maintainerQuoted 8 lines · Yanfei Xu
The value of "vmalloc=" set in cmdline is always 8M more than the value of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user expect to get the size what they input, and no need to consider the 8M "hole" hided in codes. This commit make real vmalloc size equal to value of "vmalloc=" in cmdline.
Also, the commit will reduce the size of vmalloc printed in boot message by 8M when the size set in cmdline is irrational.
Hi,
I think I'd like to do several cleanups with this:
1. change vmalloc_min to be an unsigned long.
2. exclude VMALLOC_OFFSET from vmalloc_min, moving it into adjust_lowmem_bounds where vmalloc_min is used.
3. rename vmalloc_min to be vmalloc_start
4. enforce vmalloc_start to be a multiple of 2MiB
5. in early_vmalloc(), calculate vmalloc_max as:
VMALLOC_END - (PAGE_OFFSET + SZ_32M + VMALLOC_OFFSET)
and use that to set the upper bound of vmalloc_reserve (which is something your patch doesn't do, which I think is a bug.
Thoughts?
Quoted 44 lines
Signed-off-by Yanfei Xu <[email protected]>--- arch/arm/mm/mmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)arch/arm/mm/mmu.c +5
-4@@ -1133,19 +1133,20 @@ static int __init early_vmalloc(char *arg) {unsigned long vmalloc_reserve =memparse (arg,NULL ); -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 ); }if (vmalloc_reserve >VMALLOC_END - (PAGE_OFFSET +SZ_32M )) { - vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); + vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M +VMALLOC_OFFSET );pr_warn ("vmalloc area is too big, limiting to %luMB\n" , vmalloc_reserve >>20 ); } - vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve); + vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve -VMALLOC_OFFSET );return 0 ; }early_param ("vmalloc" , early_vmalloc);Signature · 7 lines
2.27.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Russell King (Oracle)
maintainerQuoted 24 lines · Russell King (Oracle)
Quoted 8 lines · Yanfei Xu
The value of "vmalloc=" set in cmdline is always 8M more than the value of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user expect to get the size what they input, and no need to consider the 8M "hole" hided in codes. This commit make real vmalloc size equal to value of "vmalloc=" in cmdline.
Also, the commit will reduce the size of vmalloc printed in boot message by 8M when the size set in cmdline is irrational.
Hi,
I think I'd like to do several cleanups with this:
1. change
vmalloc_minto be an unsigned long.
2. excludeVMALLOC_OFFSETfromvmalloc_min, moving it intoadjust_lowmem_boundswherevmalloc_minis used.
3. renamevmalloc_minto bevmalloc_start
4. enforcevmalloc_startto be a multiple of 2MiB
5. inearly_vmalloc(), calculatevmalloc_maxas:
VMALLOC_END- (PAGE_OFFSET+SZ_32M+VMALLOC_OFFSET)
and use that to set the upper bound ofvmalloc_reserve(which is something your patch doesn't do, which I think is a bug.
Quoted 1 line
Thoughts?
I've slightly modified the above idea, and will shortly follow up with some patches to show the idea a bit better...
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
PATCH 1/4 ARM: change vmalloc_min to be unsigned long
vmalloc_min is currently a void pointer, but everywhere its used contains a cast - either to a void pointer when setting or back to an integer type when being used. Eliminate these casts by changing its type to unsigned long.
--- arch/arm/mm/mmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mm/mmu.c +4 -4
@@ -1123,8 +1123,8 @@ void __init debug_ll_io_init(void) }#endif -static void *__initdata vmalloc_min = - (void *)(VMALLOC_END - (240 <<20 ) -VMALLOC_OFFSET ); +static unsigned long __initdata vmalloc_min = +VMALLOC_END - (240 <<20 ) -VMALLOC_OFFSET ;/* * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -1147,7 +1147,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve); + vmalloc_min =VMALLOC_END - vmalloc_reserve;return 0 ; }early_param ("vmalloc" , early_vmalloc);
@@ -1167,7 +1167,7 @@ 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 )(uintptr_t )vmalloc_min -PAGE_OFFSET +PHYS_OFFSET ; + vmalloc_limit = (u64 )vmalloc_min -PAGE_OFFSET +PHYS_OFFSET ;/* * The first usable region must be PMD aligned. Mark its start
Signature · 1 line
2.20.1
Re: [PATCH 1/4] ARM: change vmalloc_min to be unsigned long
Quoted 6 lines · Russell King (Oracle)
vmalloc_minis currently a void pointer, but everywhere its used contains a cast - either to a void pointer when setting or back to an integer type when being used. Eliminate these casts by changing its type to unsigned long.Signed-off-by Russell King (Oracle) <[email protected]>
Looks good!
Yours,
Linus Walleij
PATCH 2/4 ARM: use a temporary variable to hold maximum vmalloc size
In reply to Russell King (Oracle)We calculate the maximum size of the vmalloc space twice in early_vmalloc(). Use a temporary variable to hold this value.
--- arch/arm/mm/mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mm/mmu.c +4 -2
@@ -1134,6 +1134,7 @@ static unsigned long __initdata vmalloc_min =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 ;
@@ -1141,8 +1142,9 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } -if (vmalloc_reserve >VMALLOC_END - (PAGE_OFFSET +SZ_32M )) { - vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); + vmalloc_max =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); +if (vmalloc_reserve > vmalloc_max) { + vmalloc_reserve = vmalloc_max;pr_warn ("vmalloc area is too big, limiting to %luMB\n" , vmalloc_reserve >>20 ); }
Signature · 1 line
2.20.1
Re: [PATCH 2/4] ARM: use a temporary variable to hold maximum vmalloc size
Quoted 4 lines · Russell King (Oracle)
We calculate the maximum size of the vmalloc space twice in
early_vmalloc(). Use a temporary variable to hold this value.Signed-off-by Russell King (Oracle) <[email protected]>
Yours,
Linus Walleij
PATCH 3/4 ARM: change vmalloc_min to vmalloc_start
In reply to Russell King (Oracle)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.
--- arch/arm/mm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/mm/mmu.c +5 -5
@@ -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);
@@ -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
Signature · 1 line
2.20.1
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>
Quoted 1 line
+static unsigned long
__initdatavmalloc_start=VMALLOC_END- (240 << 20);
When I first read this it took me some time to figure out what was going on here, so if you have time, please fold in a comment with some explanation of that (240 << 20) thing, in some blog post I described it as "an interesting way to write 0x0f000000" but I suppose commit 0536bdf33faf chose this way for a specific reason? (Paging Nico if he can explain it.)
Yours,
Linus Walleij
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 11 lines · Linus Walleij
Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>Reviewed-by Linus Walleij <[email protected]>
Quoted 8 lines
Quoted 1 line
+static unsigned long
__initdatavmalloc_start=VMALLOC_END- (240 << 20);When I first read this it took me some time to figure out what was going on here, so if you have time, please fold in a comment with some explanation of that (240 << 20) thing, in some blog post I described it as "an interesting way to write
0x0f000000" but I suppose commit0536bdf33fafchose this way for a specific reason? (Paging Nico if he can explain it.)
That's an alternative (and deprecated) way to write MB(240).
Nicolas
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 15 lines · Nicolas Pitre
Quoted 13 lines · Linus Walleij
Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>Reviewed-by Linus Walleij <[email protected]>Quoted 1 line
+static unsigned long
__initdatavmalloc_start=VMALLOC_END- (240 << 20);
Quoted 8 lines
Quoted 6 lines
When I first read this it took me some time to figure out what was going on here, so if you have time, please fold in a comment with some explanation of that (240 << 20) thing, in some blog post I described it as "an interesting way to write
0x0f000000" but I suppose commit0536bdf33fafchose this way for a specific reason? (Paging Nico if he can explain it.)That's an alternative (and deprecated) way to write MB(240).
And it seems that MB() isn't globally defined either. Oh well.
Nicolas
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 8 lines · Nicolas Pitre
Quoted 5 lines · Nicolas Pitre
Quoted 2 lines · Linus Walleij
please fold in a comment
with some explanation of that (240 << 20) thing,That's an alternative (and deprecated) way to write MB(240).
And it seems that
MB()isn't globally defined either. Oh well.
I suppose a comment saying "set vmalloc to be 240 MB" is fair enough.
(And I do feel silly for not realizing that...)
Yours,
Linus Walleij
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 11 lines · Linus Walleij
Quoted 8 lines · Nicolas Pitre
Quoted 5 lines · Nicolas Pitre
Quoted 2 lines · Linus Walleij
please fold in a comment
with some explanation of that (240 << 20) thing,That's an alternative (and deprecated) way to write MB(240).
And it seems that
MB()isn't globally defined either. Oh well.I suppose a comment saying "set vmalloc to be 240 MB" is fair enough.
The comment was some 5 lines below (not ideal I know).
Nicolas
Russell King (Oracle)
maintainerRe: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
In reply to Nicolas PitreQuoted 24 lines · Nicolas Pitre
Quoted 22 lines · Nicolas Pitre
Quoted 19 lines · Linus Walleij
Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>Reviewed-by Linus Walleij <[email protected]>Quoted 1 line
+static unsigned long
__initdatavmalloc_start=VMALLOC_END- (240 << 20);When I first read this it took me some time to figure out what was going on here, so if you have time, please fold in a comment with some explanation of that (240 << 20) thing, in some blog post I described it as "an interesting way to write
0x0f000000" but I suppose commit0536bdf33fafchose this way for a specific reason? (Paging Nico if he can explain it.)
Quoted 3 lines
Quoted 1 line
That's an alternative (and deprecated) way to write MB(240).
And it seems that
MB()isn't globally defined either. Oh well.
I could add a patch on the end of the series changing it to 240 * SZ_1M which will likely be clearer.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
In reply to Russell King (Oracle)Quoted 43 lines · Russell King (Oracle)
[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 theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>--- arch/arm/mm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)arch/arm/mm/mmu.c +3
-4@@ -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);
arch/arm/mm/mmu.c void __init adjust_lowmem_bounds(void) · line 1173
Quoted 7 lines
arch/arm/mm/mmu.c +2
-1@@ -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 );
Here is bug, it should be
vmalloc_limit = (u64)vmalloc_start -
(PAGE_OFFSET + VMALLOC_OFFSET) + PHYS_OFFSET;
Quoted 5 lines
arch/arm/mm/mmu.c +0
-1/* * The first usable region must be PMD aligned. Mark its start -- 2.20.1
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Russell King (Oracle)
maintainerRe: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 17 lines · Yanfei
Quoted 7 lines · Russell King (Oracle)
arch/arm/mm/mmu.c +1
-2-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' arch/arm/mm/mmu.c void __init adjust_lowmem_bounds(void) · line 1173
Quoted 7 lines
arch/arm/mm/mmu.c +2
-1@@ -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 );Here is bug, it should be
Quoted 2 lines
vmalloc_limit= (u64)vmalloc_start -
(PAGE_OFFSET+VMALLOC_OFFSET) +PHYS_OFFSET;
Yes, you're absolutely right, thanks for catching that!
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 20 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 17 lines · Yanfei
Quoted 7 lines · Russell King (Oracle)
arch/arm/mm/mmu.c +1
-2-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' arch/arm/mm/mmu.c void __init adjust_lowmem_bounds(void) · line 1173
Quoted 7 lines
arch/arm/mm/mmu.c +2
-1@@ -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 );Here is bug, it should be
Quoted 5 lines
Quoted 2 lines
vmalloc_limit= (u64)vmalloc_start -
(PAGE_OFFSET+VMALLOC_OFFSET) +PHYS_OFFSET;Yes, you're absolutely right, thanks for catching that!
Hi Russell,
Will you send v2? (or I missed something.)
Thanks,
Yanfei
Quoted 4 lines
--
RMK's Patch system: https://urldefense.com/v3/__https://www.armlinux.org.uk/developer/patches/__;!!AjveYdw8EvQ!M3h7vuBembpLOcv9xTj5vzxlU0dxXMOa1lDX4yN6u4l-TwnuZ3-ldjYom-7ZQYpsVYc$
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Russell King (Oracle)
maintainerRe: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
Quoted 3 lines · Yanfei
Hi Russell,
Will you send v2? (or I missed something.)
Yes - I've been a little distracted during the last week or so. New version is in progress.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH 3/4] ARM: change vmalloc_min to vmalloc_start
In reply to Russell King (Oracle)Quoted 32 lines · Russell King (Oracle)
[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 theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>--- arch/arm/mm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)arch/arm/mm/mmu.c +2
-3@@ -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) {
arch/arm/mm/mmu.c static int __init early_vmalloc(char *arg) · line 1154
Quoted 10 lines
arch/arm/mm/mmu.c +1
-1vmalloc_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
arch/arm/mm/mmu.c +3 -2
@@ -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
Quoted 13 lines
arch/arm/mm/mmu.c +2
-2@@ -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
PATCH 4/4 ARM: change vmalloc_start to vmalloc_size
In reply to Russell King (Oracle)Rather than storing the start of vmalloc space, store the size, and move the calculation into adjust_lowmem_limit(). We now have one single place where this calculation takes place.
--- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mm/mmu.c +3 -3
@@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) }#endif -static unsigned long __initdata vmalloc_start =VMALLOC_END - (240 <<20 ); +static unsigned long __initdata vmalloc_size =240 <<20 ;/* * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -1148,7 +1148,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_start =VMALLOC_END - vmalloc_reserve; + vmalloc_size = vmalloc_reserve;return 0 ; }early_param ("vmalloc" , early_vmalloc);
@@ -1168,7 +1168,7 @@ 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_start - + vmalloc_limit = (u64)(VMALLOC_END - vmalloc_size) - (PAGE_OFFSET +PHYS_OFFSET +VMALLOC_OFFSET );/*
Signature · 1 line
2.20.1
Re: [PATCH 4/4] ARM: change vmalloc_start to vmalloc_size
Quoted 5 lines · Russell King (Oracle)
Rather than storing the start of vmalloc space, store the size, and move the calculation into
adjust_lowmem_limit(). We now have one single place where this calculation takes place.Signed-off-by Russell King (Oracle) <[email protected]>
This is really nice.
Yours,
Linus Walleij
Quoted 27 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 24 lines · Russell King (Oracle)
Quoted 8 lines · Yanfei Xu
The value of "vmalloc=" set in cmdline is always 8M more than the value of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user expect to get the size what they input, and no need to consider the 8M "hole" hided in codes. This commit make real vmalloc size equal to value of "vmalloc=" in cmdline.
Also, the commit will reduce the size of vmalloc printed in boot message by 8M when the size set in cmdline is irrational.
Hi,
I think I'd like to do several cleanups with this:
1. change
vmalloc_minto be an unsigned long.
2. excludeVMALLOC_OFFSETfromvmalloc_min, moving it intoadjust_lowmem_boundswherevmalloc_minis used.
3. renamevmalloc_minto bevmalloc_start
4. enforcevmalloc_startto be a multiple of 2MiB
5. inearly_vmalloc(), calculatevmalloc_maxas:
VMALLOC_END- (PAGE_OFFSET+SZ_32M+VMALLOC_OFFSET)
and use that to set the upper bound ofvmalloc_reserve(which is something your patch doesn't do, which I think is a bug.
Quoted 5 lines
Quoted 1 line
Thoughts?
I've slightly modified the above idea, and will shortly follow up with some patches to show the idea a bit better...
Thanks for making it better!
Regards,
Yanfei
Quoted 4 lines
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 30 lines · Yanfei
Quoted 27 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
Quoted 24 lines · Russell King (Oracle)
Quoted 8 lines · Yanfei Xu
The value of "vmalloc=" set in cmdline is always 8M more than the value of "VmallocTotal" in meminfo. When use the "vmalloc=" parameter, user expect to get the size what they input, and no need to consider the 8M "hole" hided in codes. This commit make real vmalloc size equal to value of "vmalloc=" in cmdline.
Also, the commit will reduce the size of vmalloc printed in boot message by 8M when the size set in cmdline is irrational.
Hi,
I think I'd like to do several cleanups with this:
1. change
vmalloc_minto be an unsigned long.
2. excludeVMALLOC_OFFSETfromvmalloc_min, moving it intoadjust_lowmem_boundswherevmalloc_minis used.
3. renamevmalloc_minto bevmalloc_start
4. enforcevmalloc_startto be a multiple of 2MiB
5. inearly_vmalloc(), calculatevmalloc_maxas:
VMALLOC_END- (PAGE_OFFSET+SZ_32M+VMALLOC_OFFSET) and use that to set the upper bound ofvmalloc_reserve(which is something your patch doesn't do, which I think is a bug.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Thoughts?
I've slightly modified the above idea, and will shortly follow up with some patches to show the idea a bit better...
Thanks for making it better!
Hi Russell,
I am not much familar with community contribution. In this case, what kind of tags should I reply? signed-off-by? Reviewed-by? or any other tags?
Regards,
Yanfei
Quoted 5 lines
Regards,
YanfeiQuoted 3 lines
Signature · 1 line
RMK's Patch system: https://urldefense.com/v3/__https://www.armlinux.org.uk/developer/patches/__;!!AjveYdw8EvQ!Mz6E44Glfsb6CPijsZ50Ofca9g8UAgL2MRQpaxa18ZTAIrVQpH0IcyqGDwHSWphEoo8$ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Hello Yanfei,
Am Wed, May 19, 2021 at 01:32:23PM +0800 schrieb Xu, Yanfei:
Quoted 3 lines
I am not much familar with community contribution. In this case, what kind of tags should I reply? signed-off-by? Reviewed-by? or any other tags?
This is explained in kernel documentation, starts here with Acked-by:, Cc:, and Co-developed-by:
And is followed by Reported-by:, Tested-by:, Reviewed-by:, Suggested-by:, and Fixes:
Hope that helps.
Alex
Quoted 12 lines · Alexander Dahl
[Please note: This e-mail is from an EXTERNAL e-mail address]
Hello Yanfei,
Am Wed, May 19, 2021 at 01:32:23PM +0800 schrieb Xu, Yanfei:
Quoted 3 lines
I am not much familar with community contribution. In this case, what kind of tags should I reply? signed-off-by? Reviewed-by? or any other tags?
This is explained in kernel documentation, starts here with Acked-by:, Cc:, and Co-developed-by:
Quoted 7 lines
And is followed by Reported-by:, Tested-by:, Reviewed-by:, Suggested-by:, and Fixes:
These links really help! Thanks for your kind explain. :)
Regards,
Yanfei
Quoted 3 lines
Hope that helps.
Alex
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 1/6 ARM: change vmalloc_min to be unsigned long
In reply to Russell King (Oracle)vmalloc_min is currently a void pointer, but everywhere its used contains a cast - either to a void pointer when setting or back to an integer type when being used. Eliminate these casts by changing its type to unsigned long.
--- arch/arm/mm/mmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mm/mmu.c +4 -4
@@ -1123,8 +1123,8 @@ void __init debug_ll_io_init(void) }#endif -static void *__initdata vmalloc_min = - (void *)(VMALLOC_END - (240 <<20 ) -VMALLOC_OFFSET ); +static unsigned long __initdata vmalloc_min = +VMALLOC_END - (240 <<20 ) -VMALLOC_OFFSET ;/* * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -1147,7 +1147,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_min = (void *)(VMALLOC_END - vmalloc_reserve); + vmalloc_min =VMALLOC_END - vmalloc_reserve;return 0 ; }early_param ("vmalloc" , early_vmalloc);
@@ -1167,7 +1167,7 @@ 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 )(uintptr_t )vmalloc_min -PAGE_OFFSET +PHYS_OFFSET ; + vmalloc_limit = (u64 )vmalloc_min -PAGE_OFFSET +PHYS_OFFSET ;/* * The first usable region must be PMD aligned. Mark its start
Signature · 1 line
2.20.1
Re: [PATCH v2 1/6] ARM: change vmalloc_min to be unsigned long
Quoted 7 lines · Russell King (Oracle)
vmalloc_minis currently a void pointer, but everywhere its used contains a cast - either to a void pointer when setting or back to an integer type when being used. Eliminate these casts by changing its type to unsigned long.Reviewed-by Linus Walleij<[email protected]>Signed-off-by Russell King (Oracle)<[email protected]>
Regards,
Yanfei
PATCH v2 2/6 ARM: use a temporary variable to hold maximum vmalloc size
In reply to Russell King (Oracle)We calculate the maximum size of the vmalloc space twice in early_vmalloc(). Use a temporary variable to hold this value.
--- arch/arm/mm/mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mm/mmu.c +4 -2
@@ -1134,6 +1134,7 @@ static unsigned long __initdata vmalloc_min =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 ;
@@ -1141,8 +1142,9 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } -if (vmalloc_reserve >VMALLOC_END - (PAGE_OFFSET +SZ_32M )) { - vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); + vmalloc_max =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); +if (vmalloc_reserve > vmalloc_max) { + vmalloc_reserve = vmalloc_max;pr_warn ("vmalloc area is too big, limiting to %luMB\n" , vmalloc_reserve >>20 ); }
Signature · 1 line
2.20.1
Re: [PATCH v2 2/6] ARM: use a temporary variable to hold maximum vmalloc size
Quoted 7 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
We calculate the maximum size of the vmalloc space twice in
early_vmalloc(). Use a temporary variable to hold this value.Reviewed-by Linus Walleij <[email protected]>Signed-off-by Russell King (Oracle) <[email protected]>
Regards,
Yanfei
Quoted 31 lines
--- arch/arm/mm/mmu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)arch/arm/mm/mmu.c +4
-3@@ -1134,6 +1134,7 @@ static unsigned long __initdata vmalloc_min =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 ;@@ -1141,8 +1142,9 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } -if (vmalloc_reserve >VMALLOC_END - (PAGE_OFFSET +SZ_32M )) { - vmalloc_reserve =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); + vmalloc_max =VMALLOC_END - (PAGE_OFFSET +SZ_32M ); +if (vmalloc_reserve > vmalloc_max) { + vmalloc_reserve = vmalloc_max;pr_warn ("vmalloc area is too big, limiting to %luMB\n" , vmalloc_reserve >>20 ); } --2.20.1
PATCH v2 3/6 ARM: change vmalloc_min to vmalloc_start
In reply to Russell King (Oracle)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.
--- arch/arm/mm/mmu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm/mm/mmu.c +5 -5
@@ -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);
@@ -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 -VMALLOC_OFFSET - +PAGE_OFFSET +PHYS_OFFSET ;/* * The first usable region must be PMD aligned. Mark its start
Signature · 1 line
2.20.1
Re: [PATCH v2 3/6] ARM: change vmalloc_min to vmalloc_start
Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle) <[email protected]>
Yours,
Linus Walleij
Re: [PATCH v2 3/6] ARM: change vmalloc_min to vmalloc_start
In reply to Russell King (Oracle)Quoted 5 lines · Russell King (Oracle)
Change the current
vmalloc_min, which is supposed to be the lowest address of vmalloc space including theVMALLOC_OFFSET, tovmalloc_startwhich does not includeVMALLOC_OFFSET.Signed-off-by Russell King (Oracle)<[email protected]>
Thanks!
Regards,
Yanfei
PATCH v2 4/6 ARM: change vmalloc_start to vmalloc_size
In reply to Russell King (Oracle)Rather than storing the start of vmalloc space, store the size, and move the calculation into adjust_lowmem_limit(). We now have one single place where this calculation takes place.
--- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mm/mmu.c +3 -3
@@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) }#endif -static unsigned long __initdata vmalloc_start =VMALLOC_END - (240 <<20 ); +static unsigned long __initdata vmalloc_size =240 <<20 ;/* * vmalloc=size forces the vmalloc area to be exactly 'size'
@@ -1148,7 +1148,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_start =VMALLOC_END - vmalloc_reserve; + vmalloc_size = vmalloc_reserve;return 0 ; }early_param ("vmalloc" , early_vmalloc);
@@ -1168,7 +1168,7 @@ 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_start -VMALLOC_OFFSET - + vmalloc_limit = (u64 )VMALLOC_END - vmalloc_size -VMALLOC_OFFSET -PAGE_OFFSET +PHYS_OFFSET ;/*
Signature · 1 line
2.20.1
Re: [PATCH v2 4/6] ARM: change vmalloc_start to vmalloc_size
Quoted 5 lines · Russell King (Oracle)
Rather than storing the start of vmalloc space, store the size, and move the calculation into
adjust_lowmem_limit(). We now have one single place where this calculation takes place.Signed-off-by Russell King (Oracle) <[email protected]>
Yours,
Linus Walleij
Re: [PATCH v2 4/6] ARM: change vmalloc_start to vmalloc_size
In reply to Russell King (Oracle)Quoted 7 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
Rather than storing the start of vmalloc space, store the size, and move the calculation into
adjust_lowmem_limit(). We now have one single place where this calculation takes place.Signed-off-by Russell King (Oracle) <[email protected]>
Regards,
Yanfei
Quoted 38 lines
--- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm/mm/mmu.c +3
-4@@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) }#endif -static unsigned long __initdata vmalloc_start =VMALLOC_END - (240 <<20 ); +static unsigned long __initdata vmalloc_size =240 <<20 ;/* * vmalloc=size forces the vmalloc area to be exactly 'size' @@ -1148,7 +1148,7 @@ static int __init early_vmalloc(char *arg) vmalloc_reserve >> 20); } - vmalloc_start =VMALLOC_END - vmalloc_reserve; + vmalloc_size = vmalloc_reserve;return 0 ; }early_param ("vmalloc" , early_vmalloc);@@ -1168,7 +1168,7 @@ 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_start -VMALLOC_OFFSET - + vmalloc_limit = (u64 )VMALLOC_END - vmalloc_size -VMALLOC_OFFSET -PAGE_OFFSET +PHYS_OFFSET ;/* -- 2.20.1
PATCH v2 5/6 ARM: use "* SZ_1M" rather than "<< 20"
In reply to Russell King (Oracle)Make the default vmalloc size clearer by using a more natural multiplication by SZ_1M rather than a shift left by 20 bits.
--- arch/arm/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mm/mmu.c +1 -1
@@ -1123,7 +1123,7 @@ void __init debug_ll_io_init(void) }#endif -static unsigned long __initdata vmalloc_size =240 <<20 ; +static unsigned long __initdata vmalloc_size =240 *SZ_1M ;/* * vmalloc=size forces the vmalloc area to be exactly 'size'
Signature · 1 line
2.20.1
Re: [PATCH v2 5/6] ARM: use "* SZ_1M" rather than "<< 20"
Quoted 4 lines · Russell King (Oracle)
Make the default vmalloc size clearer by using a more natural multiplication by
SZ_1Mrather than a shift left by 20 bits.Signed-off-by Russell King (Oracle) <[email protected]>
Excellent, thanks!
Yours,
Linus Walleij
Re: [PATCH v2 5/6] ARM: use "* SZ_1M" rather than "<< 20"
In reply to Russell King (Oracle)Quoted 4 lines · Russell King (Oracle)
Make the default vmalloc size clearer by using a more natural multiplication by
SZ_1Mrather than a shift left by 20 bits.Signed-off-by Russell King (Oracle)<[email protected]>
Regards,
Yanfei
Quoted 1 line
---
PATCH v2 6/6 ARM: use MiB for vmalloc sizes
In reply to Russell King (Oracle)Rather than using "m" (which is the unit of metres, or milli), and "MB" in the printk statements, use MiB to make it clear that we are talking about the power-of-2 megabytes, aka mebibytes.
--- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mm/mmu.c +3 -3
@@ -1128,7 +1128,7 @@ static unsigned long __initdata vmalloc_size = 240 * SZ_1M;/* * vmalloc=size forces the vmalloc area to be exactly 'size' * bytes. This can be used to increase (or decrease) the vmalloc -* area - the default is 240m. +* area - the default is 240MiB. */ static int __init early_vmalloc (char *arg) {
@@ -1137,14 +1137,14 @@ static int __init early_vmalloc(char *arg)if (vmalloc_reserve <SZ_16M ) { vmalloc_reserve =SZ_16M ; -pr_warn ("vmalloc area too small, limiting to %luMB\n" , +pr_warn ("vmalloc area is too small, limiting to %luMiB\n" , vmalloc_reserve >>20 ); } 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" , +pr_warn ("vmalloc area is too big, limiting to %luMiB\n" , vmalloc_reserve >>20 ); }
Signature · 1 line
2.20.1
Re: [PATCH v2 6/6] ARM: use MiB for vmalloc sizes
Quoted 6 lines · Russell King (Oracle)
Rather than using "m" (which is the unit of metres, or milli), and "MB" in the printk statements, use MiB to make it clear that we are talking about the power-of-2 megabytes, aka mebibytes.
Signed-off-by Russell King (Oracle) <[email protected]>
Yours,
Linus Walleij
Re: [PATCH v2 6/6] ARM: use MiB for vmalloc sizes
In reply to Russell King (Oracle)Quoted 7 lines · Russell King (Oracle)
[Please note: This e-mail is from an EXTERNAL e-mail address]
Rather than using "m" (which is the unit of metres, or milli), and "MB" in the printk statements, use MiB to make it clear that we are talking about the power-of-2 megabytes, aka mebibytes.
Signed-off-by Russell King (Oracle) <[email protected]>
Regards,
Yanfei
Quoted 37 lines
--- arch/arm/mm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)arch/arm/mm/mmu.c +3
-4@@ -1128,7 +1128,7 @@ static unsigned long __initdata vmalloc_size = 240 * SZ_1M;/* * vmalloc=size forces the vmalloc area to be exactly 'size' * bytes. This can be used to increase (or decrease) the vmalloc -* area - the default is 240m. +* area - the default is 240MiB. */ static int __init early_vmalloc (char *arg) {@@ -1137,14 +1137,14 @@ static int __init early_vmalloc(char *arg)if (vmalloc_reserve <SZ_16M ) { vmalloc_reserve =SZ_16M ; -pr_warn ("vmalloc area too small, limiting to %luMB\n" , +pr_warn ("vmalloc area is too small, limiting to %luMiB\n" , vmalloc_reserve >>20 ); } 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" , +pr_warn ("vmalloc area is too big, limiting to %luMiB\n" , vmalloc_reserve >>20 ); } --2.20.1