linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v3.
@ 2008-04-07 12:43 Yasunori Goto
  2008-04-07 12:45 ` [Patch 001/005](memory hotplug) register section/node id to free Yasunori Goto
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Yasunori Goto @ 2008-04-07 12:43 UTC (permalink / raw)
  To: Badari Pulavarty, Andrew Morton
  Cc: Linux Kernel ML, linux-mm, Yinghai Lu, Yasunori Goto


Hello.

This is v3 for freeing pages which is allocated by bootmem
for memory hot-remove.

Please apply.

---
This patch set is to free pages which is allocated by bootmem for
memory-hotremove. Some structures of memory management are
allocated by bootmem. ex) memmap, etc.
To remove memory physically, some of them must be freed according
to circumstance.
This patch set makes basis to free those pages, and free memmaps.

Basic my idea is using remain members of struct page to remember
information of users of bootmem (section number or node id).
When the section is removing, kernel can confirm it.
By this information, some issues can be solved.

  1) When the memmap of removing section is allocated on other
     section by bootmem, it should/can be free. 
  2) When the memmap of removing section is allocated on the
     same section, it shouldn't be freed. Because the section has to be
     logical memory offlined already and all pages must be isolated against
     page allocater. If it is freed, page allocator may use it which will
     be removed physically soon.
  3) When removing section has other section's memmap, 
     kernel will be able to show easily which section should be removed
     before it for user. (Not implemented yet)
  4) When the above case 2), the page isolation will be able to check and skip
     memmap's page when logical memory offline (offline_pages()).
     Current page isolation code fails in this case because this page is 
     just reserved page and it can't distinguish this pages can be
     removed or not. But, it will be able to do by this patch.
     (Not implemented yet.)
  5) The node information like pgdat has similar issues. But, this
     will be able to be solved too by this.
     (Not implemented yet, but, remembering node id in the pages.)

Fortunately, current bootmem allocator just keeps PageReserved flags,
and doesn't use any other members of page struct. The users of
bootmem doesn't use them too.

This patch set is for 2.6.25-rc8-mm1.

Change log since v2.
  - Rebase for 2.6.25-rc8-mm1.
  - Fix panic at boot when CONFIG_SPARSEMEM_VMEMMAP is selected,
    and kernel returns EBUSY for physical removing.
    (This should be removed after it can do.)
  - Change not good comments.

Change log since v1.
  - allocate usemap on same section of pgdat. usemap's page is hard to be removed
    until other sections removing. This is avoid dependency problem between
    sections.
  - make alloc_bootmem_section() for above.
  - fix compile error for other config.
  - Add user counting. If a page is used by some user, it can be checked.

Todo:
  - for SPARSEMEM_VMEMMAP.
    Freeing vmemmap's page is more diffcult than normal sparsemem.
    Because not only memmap's page, but also the pages like page table must
    be removed too. If removing section has pages for , then it must
    be migrated too. Relocatable page table is necessary.
    (Ross Biro-san is working for it.)
    http://marc.info/?l=linux-mm&m=120110502617654&w=2



Thanks.



-- 
Yasunori Goto 

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v2.
@ 2008-04-03  5:37 Yasunori Goto
  2008-04-03  5:41 ` [Patch 003/005](memory hotplug) make alloc_bootmem_section() Yasunori Goto
  0 siblings, 1 reply; 18+ messages in thread
From: Yasunori Goto @ 2008-04-03  5:37 UTC (permalink / raw)
  To: Badari Pulavarty
  Cc: Andrew Morton, Yasunori Goto, Linux Kernel ML, Yinghai Lu, linux-mm


Hello.

I update my patch set to free pages which is allocated by bootmem.
Please comment.

---
This patch set is to free pages which is allocated by bootmem for
memory-hotremove. Some structures of memory management are
allocated by bootmem. ex) memmap, etc.
To remove memory physically, some of them must be freed according
to circumstance.
This patch set makes basis to free those pages, and free memmaps.

Basic my idea is using remain members of struct page to remember
information of users of bootmem (section number or node id).
When the section is removing, kernel can confirm it.
By this information, some issues can be solved.

  1) When the memmap of removing section is allocated on other
     section by bootmem, it should/can be free. 
  2) When the memmap of removing section is allocated on the
     same section, it shouldn't be freed. Because the section has to be
     offlined already and all pages must be isolated against
     page allocater.
  3) When removing section has other section's memmap, 
     kernel will be able to show easily which section should be removed
     before it for user. (Not implemented yet)
  4) When the above case 2), the page migrator will be able to check and skip
     memmap againt page isolation when page offline.
     Current page migration fails in this case because this page is 
     just reserved page and it can't distinguish this pages can be
     removed or not. But, it will be able to do by this patch.
     (Not implemented yet.)
  5) The node information like pgdat has similar issues. But, this
     will be able to be solved too by this.
     (Not implemented yet, but, remembering node id in the pages.)

Fortunately, current bootmem allocator just keeps PageReserved flags,
and doesn't use any other members of page struct. The users of
bootmem doesn't use them too.

This patch set is for 2.6.25-rc5-mm1.
And it needs Badari-san's generic __remove_pages() support patch.
  http://marc.info/?l=linux-kernel&m=120666094428775&w=2

Change log since v1.
  - allocate usemap on same section of pgdat. usemap's page is hard to be removed
    until other sections removing. This is avoid dependency problem between
    sections.
  - make alloc_bootmem_section() for above.
  - fix compile error for other config.
  - Add user counting. If a page is used by some user, it can be checked.

Todo:
  - for SPARSEMEM_VMEMMAP.
    Freeing vmemmap's page is more diffcult than normal sparsemem.
    Because not only memmap's page, but also the pages like page table must
    be removed too. If removing section has pages for , then it must
    be migrated too. Relocatable page table is necessary.
    (Ross Biro-san is working for it.)
    http://marc.info/?l=linux-mm&m=120110502617654&w=2



Thanks.



-- 
Yasunori Goto 

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-06-17 11:39 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-07 12:43 [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v3 Yasunori Goto
2008-04-07 12:45 ` [Patch 001/005](memory hotplug) register section/node id to free Yasunori Goto
2008-06-16 10:21   ` Andy Whitcroft
2008-06-16 13:58     ` Yasunori Goto
2008-06-17 11:39       ` [Patch](memory hotplug) Tiny fixes of bootmem free patch for memory hotremove Yasunori Goto
2008-04-07 12:46 ` [Patch 002/005](memory hotplug) align memmap to page size Yasunori Goto
2008-06-16 10:26   ` Andy Whitcroft
2008-06-16 13:26     ` Yasunori Goto
2008-04-07 12:47 ` [Patch 003/005](memory hotplug) make alloc_bootmem_section() Yasunori Goto
2008-06-16 10:32   ` Andy Whitcroft
2008-06-16 13:18     ` Yasunori Goto
2008-04-07 12:48 ` [Patch 004/005](memory hotplug)allocate usemap on the section with pgdat Yasunori Goto
2008-04-07 12:50 ` [Patch 005/005](memory hotplug) free memmaps allocated by bootmem Yasunori Goto
2008-06-16 10:44   ` Andy Whitcroft
2008-06-16 14:09     ` Yasunori Goto
  -- strict thread matches above, loose matches on Subject: below --
2008-04-03  5:37 [Patch 000/005](memory hotplug) freeing pages allocated by bootmem for hotremove v2 Yasunori Goto
2008-04-03  5:41 ` [Patch 003/005](memory hotplug) make alloc_bootmem_section() Yasunori Goto
2008-04-03  5:52   ` Yinghai Lu
2008-04-03  6:07     ` Yasunori Goto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox