Thread (16 messages) 16 messages, 4 authors, 2009-08-21

Re: [Patch 8/8] kexec: allow to shrink reserved memory

From: Amerigo Wang <hidden>
Date: 2009-08-18 08:51:51
Also in: lkml

KAMEZAWA Hiroyuki wrote:
On Tue, 18 Aug 2009 14:31:23 +0800
Amerigo Wang [off-list ref] wrote:
  
quoted
Hi, thank you!
    
quoted
Can I have a question ?

  - How crash kernel's memory is preserved at boot ?
  
      
Use bootmem, I think.

    
I see.

In x86,
 
  setup_arch()
	-> reserve_crashkernel()
		-> find_and_reserve_crashkernel()
			-> reserve_bootmem_generic()

Then, all "active range" is already registered and there are memmap.


  
quoted
quoted
    It's hidden from the system before mem_init() ?
  
      
Not sure, but probably yes. It is reserved in setup_arch() which is 
before mm_init() which calls mem_init().

Do you have any advice to free that reserved memory after boot? :)

    
Let's see arch/x86/mm/init.c::free_initmem()

Maybe it's all you want.

	- ClearPageReserved()
	- init_page_count()
	- free_page()
	- totalram_pages++

But it has no argumetns. Maybe you need your own function or modification.
online_pages() does very similar. But, hmm,.. writing something open coded one
for crashkernel is not very bad, I think.
  
Nice help!

Yeah, I think we can make that be a generic wrapper function so that 
both free_initmem() and shrink_crash_memory() can use it.

Then I will update and resend the whole patchset.

Thank you!



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help