Skip to contentSkip to conversation

delete unnecessary bootmem struct page array

PATCH In review Real Name 1 participant 2 messages May 31, 2014 – Jun 1, 2014 User-mode Linux (UML)

lore
Share & tools
lore

Real Name

author
#0 lore raw

PATCH 1/1 delete unnecessary bootmem struct page array

1) uml kernel bootmem managed through bootmem_data->node_bootmem_map, not struct page array, so it is unnecessary.

2) the struct page array allocate has been pointer by a *loacl* pointer struct page *map in init_maps function. The array can't be access after the init_maps exit. As a result, there is about 1% of total memory leak.

---
 arch/um/kernel/um_arch.c | 5 -----
 1 file changed, 5 deletions(-)
arch/um/kernel/um_arch.c +0 -5
index 016adf0..9f3c6d1 100644
@@ -309,11 +309,6 @@ int __init linux_main(int argc, char **argv)
 	 */
 
 	diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
-	if (diff > 1024 * 1024) {
-		printf("Adding %ld bytes to physical memory to account for "
-		       "exec-shield gap\n", diff);
-		physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
-	}
 
 	uml_physmem = (unsigned long) &__binary_start & PAGE_MASK;
 
Signature · 1 line
1.8.3.1
author
#1 lore raw

On Sun, Jun 01, 2014 at 07:34:42AM +0800, Real Name wrote:

I'm very sorry. Please ignore this email, the wrong patch had been sent out.

Quoted 29 lines

1) uml kernel bootmem managed through bootmem_data->node_bootmem_map, not struct page array, so it is unnecessary.

2) the struct page array allocate has been pointer by a *loacl* pointer struct page *map in init_maps function. The array can't be access after the init_maps exit. As a result, there is about 1% of total memory leak.

---
 arch/um/kernel/um_arch.c | 5 -----
 1 file changed, 5 deletions(-)
arch/um/kernel/um_arch.c +0 -5
index 016adf0..9f3c6d1 100644
@@ -309,11 +309,6 @@ int __init linux_main(int argc, char **argv)
 	 */
 
 	diff = UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
-	if (diff > 1024 * 1024) {
-		printf("Adding %ld bytes to physical memory to account for "
-		       "exec-shield gap\n", diff);
-		physmem_size += UML_ROUND_UP(brk_start) - UML_ROUND_UP(&_end);
-	}
 
 	uml_physmem = (unsigned long) &__binary_start & PAGE_MASK;
 
Signature · 1 line
1.8.3.1