linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC:Patch: 000/008](memory hotplug) rough idea of pgdat removing
@ 2008-07-31 11:50 Yasunori Goto
  2008-07-31 11:55 ` [RFC:Patch: 001/008](memory hotplug) change parameter from pointer of zonelist to node id Yasunori Goto
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Yasunori Goto @ 2008-07-31 11:50 UTC (permalink / raw)
  To: Badari Pulavarty
  Cc: Andrew Morton, Mel Gorman, Christoph Lameter, linux-mm, Linux Kernel ML

Hello.

This patch set is first trial and to describe my rough idea of
"how to remove pgdat".

I would like to confirm "current my idea is good way or not" by this post.
This patch is incomplete and not tested yet, If my idea is good way,
I'll continue to make them and test.

I think pgdat removing is diffcult issue,
because any code doesn't know pgdat will be removed, and access
them without any locking now. But the pgdat remover must wait their access,
because the node may be removed electrically after it soon.

Current my idea is using RCU feature for waiting them.
Because it is the least impact against reader's performance,
and pgdat remover can wait finish of reader's access to pgdat
which is removing by synchronize_sched().

So, I made followings read_lock for accessing pgdat.
  - pgdat_remove_read_lock()/unlock()
  - pgdat_remove_read_lock_sleepable()/unlock_sleepable()
These definishions use rcu_read_lock and srcu_read_lock().

Writer uses node_set_offline() which uses clear_bit(),
and build_all_zonelists() with stop_machine_run().


There are a few types of pgdat access.

  1) via node_online_bitmap.
     Many code use for_each_xxx_node(), for_each_zone(), and so on.
     These code must be used with pgdat_remove_read_lock/unlock().

  2) mempolicy
     There are callback interface when memory offline works. mempolicy
     must use callbacks for disable removing node.
     This patch set includes quite simple (sample) patch to point
     what will be required. However more detail specification will be necessary.
     (ex, When preffered node of mempolicy is removing, how does kernel should do?)
  
  3) zonelist
     alloc_pages access zones via zonelist. However, zone may be removed
     by pgdat remover too. It must be check zones might be removed
     before accessing zonliest which is guarded between pgdat_remove_read_lock()
     and unlock().

  4) via NODE_DATA() with node_id.
     This type access is called with numa_node_id() in many case.
     Basically, CPUs on the removing node must be removed before removing node.
     So, I used BUG_ON() when numa_node_id() is points offlined node.
     
     If node id is specified by other way, offline_node must be checked and
     escape when it is offline...


If my idea is bad way, other way I can tell is...
  - read_write_lock(). (It should n't be used...)
  - collect pgdats on one node (depends on performance)

If you have better idea, please let me know.


Note: 
  - I don't add pgdat_remove_read_lock() on boot code.
    Because pgdat hot-removing will not work at boot time.
    (But I may overlook some places which must use pgdat_remove_read_lock() yet.)


Thanks.


-- 
Yasunori Goto 


--
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>

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

end of thread, other threads:[~2008-09-08  3:07 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-31 11:50 [RFC:Patch: 000/008](memory hotplug) rough idea of pgdat removing Yasunori Goto
2008-07-31 11:55 ` [RFC:Patch: 001/008](memory hotplug) change parameter from pointer of zonelist to node id Yasunori Goto
2008-07-31 11:56 ` [RFC:Patch: 002/008](memory hotplug) pgdat_remove_read_lock/unlock Yasunori Goto
2008-07-31 11:58 ` [RFC:Patch: 003/008](memory hotplug) check node online in __alloc_pages Yasunori Goto
2008-07-31 12:00 ` [RFC:Patch: 004/008](memory hotplug) Use lock for for_each_online_node Yasunori Goto
2008-07-31 12:01 ` [RFC:Patch: 005/008](memory hotplug) check node online before NODE_DATA and so on Yasunori Goto
2008-07-31 12:02 ` [RFC:Patch: 006/008](memory hotplug) kswapd_stop() definition Yasunori Goto
2008-07-31 12:03 ` [RFC:Patch: 007/008](memory hotplug) callback routine for mempolicy Yasunori Goto
2008-07-31 12:04 ` [RFC:Patch: 008/008](memory hotplug) remove_pgdat() function Yasunori Goto
2008-09-06 14:21   ` Peter Zijlstra
2008-09-08  3:07     ` Yasunori Goto
2008-07-31 14:04 ` [RFC:Patch: 000/008](memory hotplug) rough idea of pgdat removing Christoph Lameter
2008-08-01  9:42   ` Yasunori Goto
2008-08-01 13:51     ` Christoph Lameter
2008-08-02  0:16       ` Yasunori Goto
2008-08-04 13:25         ` Christoph Lameter
2008-08-05  6:39           ` Yasunori Goto
2008-08-05 11:14             ` Mel Gorman
2008-08-05 17:08               ` Christoph Lameter

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