Skip to contentSkip to conversation

don't align initmem poisoning

PATCH New Dave Hansen 1 participant 1 message Oct 7, 2004 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't align initmem poisoning

The recent initmem poison patch tries to page-align the address that it memsets. I think this is unnecessary because __init_begin is page-aligned already in the linker script:

  /* will be freed after init */
  . = ALIGN(4096);              /* Init code and data */
  __init_begin = .;
  .init.text : {

-- Dave

---

 memhotplug-dave/arch/i386/mm/init.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
arch/i386/mm/init.c renamed from arch/i386/mm/init.c~A1-no-page-align-init-poison +1 -1
diff -puN arch/i386/mm/init.c~A1-no-page-align-init-poison arch/i386/mm/init.c
@@ -723,7 +723,7 @@ void free_initmem(void)
 	for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
 		ClearPageReserved(virt_to_page(addr));
 		set_page_count(virt_to_page(addr), 1);
-		memset((void *)(addr & ~(PAGE_SIZE-1)), 0xcc, PAGE_SIZE);
+		memset((void *)addr, 0xcc, PAGE_SIZE);
 		free_page(addr);
 		totalram_pages++;
 	}

_