Skip to contentSkip to conversation

arm64:mm: initialize max_mapnr using function set_max_mapnr

PATCH Superseded Ganapatrao Kulkarni 4 participants 5 messages Sep 11, 2014 – Sep 16, 2014 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64:mm: initialize max_mapnr using function set_max_mapnr

In some config cases, max_mapnr is not defined and direct reference results in to compilation error.
This is fixed by using set_max_mapnr() helper.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/init.c +1 -1
index 5472c24..271e654 100644
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-	max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
 
 #ifndef CONFIG_SPARSEMEM_VMEMMAP
 	free_unused_memmap();
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/1 arm64:mm: initialize max_mapnr using function set_max_mapnr

Quoted 14 lines · Ganapatrao Kulkarni

In some config cases, max_mapnr is not defined and direct reference results in to compilation error.
This is fixed by using set_max_mapnr() helper.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/init.c +0 -0
index 5472c24..271e654 100644

arch/arm64/mm/init.c static void __init free_unused_memmap(void) · line 259

Quoted 5 lines
arch/arm64/mm/init.c +1 -1
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-	max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

Catalin, this is one for you (we don't support NUMA yet, so mainline isn't broken).

Will

maintainer
#2 lore raw

PATCH 1/1 arm64:mm: initialize max_mapnr using function set_max_mapnr

In reply to Ganapatrao Kulkarni
Quoted 14 lines · Ganapatrao Kulkarni

In some config cases, max_mapnr is not defined and direct reference results in to compilation error.
This is fixed by using set_max_mapnr() helper.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/init.c +0 -0
index 5472c24..271e654 100644

arch/arm64/mm/init.c static void __init free_unused_memmap(void) · line 259

Quoted 5 lines
arch/arm64/mm/init.c +1 -1
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-	max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

These are not equivalent as PHYS_PFN_OFFSET is dropped (which looks like the correct thing to do but the commit log should reflect this as well).

Signature · 1 line
Catalin
#3 lore raw

PATCH 1/1 arm64:mm: initialize max_mapnr using function set_max_mapnr

Hi Catalin,

Quoted 10 lines · Catalin Marinas
Quoted 9 lines · Ganapatrao Kulkarni

In some config cases, max_mapnr is not defined and direct reference results in to compilation error.
This is fixed by using set_max_mapnr() helper.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

arch/arm64/mm/init.c static void __init free_unused_memmap(void) · line 259

Quoted 10 lines
arch/arm64/mm/init.c +1 -1
index 5472c24..271e654 100644
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-     max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+     set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

These are not equivalent as PHYS_PFN_OFFSET is dropped (which looks like the correct thing to do but the commit log should reflect this as well).

is below comment ok for the change? if so i can resend the patch.

Initializing max_mapnr using set_max_mapnr() helper function instead of direct reference.
Also not adding PHYS_PFN_OFFSET to max_pfn, since it already contains it.

Quoted 3 lines

--
Catalin

thanks
ganapat

maintainer
#4 lore raw

PATCH 1/1 arm64:mm: initialize max_mapnr using function set_max_mapnr

Quoted 25 lines · Ganapatrao Kulkarni
Quoted 10 lines · Catalin Marinas
Quoted 9 lines · Ganapatrao Kulkarni

In some config cases, max_mapnr is not defined and direct reference results in to compilation error.
This is fixed by using set_max_mapnr() helper.

---
 arch/arm64/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines

arch/arm64/mm/init.c static void __init free_unused_memmap(void) · line 259

Quoted 10 lines
arch/arm64/mm/init.c +1 -1
index 5472c24..271e654 100644
@@ -256,7 +256,7 @@ static void __init free_unused_memmap(void)
  */
 void __init mem_init(void)
 {
-     max_mapnr   = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map;
+     set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

These are not equivalent as PHYS_PFN_OFFSET is dropped (which looks like the correct thing to do but the commit log should reflect this as well).

Quoted 5 lines

is below comment ok for the change? if so i can resend the patch.

Initializing max_mapnr using set_max_mapnr() helper function instead of direct reference.
Also not adding PHYS_PFN_OFFSET to max_pfn, since it already contains it.

Yes.

Signature · 1 line
Catalin