misc patches related to resizing nodes & zones
Subsystems (4)
v2 cover misc patches related to resizing nodes & zones
First 2 are comment fixes.
Second 2 add pgdat_resize_lock()/unlock() usage per existing documentation.
--
Since v1 (http://thread.gmane.org/gmane.linux.kernel.mm/99297):
- drop making lock_memory_hotplug() required (old patch #1)
- fix __offline_pages() in the same manner as online_pages() (rientjes)
- make comment regarding pgdat_resize_lock()/unlock() usage more clear (rientjes)
--
Cody P Schafer (4):
mm: fix comment referring to non-existent size_seqlock, change to
span_seqlock
mmzone: note that node_size_lock should be manipulated via
pgdat_resize_lock()
memory_hotplug: use pgdat_resize_lock() in online_pages()
memory_hotplug: use pgdat_resize_lock() in __offline_pages()
include/linux/mmzone.h | 5 ++++- mm/memory_hotplug.c | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.2.2
PATCH v2 1/4 mm: fix comment referring to non-existent size_seqlock, change to span_seqlock
--- include/linux/mmzone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mmzone.h +1 -1
@@ -716,7 +716,7 @@ typedef struct pglist_data {* or node_spanned_pages stay constant. Holding this will also * guarantee that any pfn_valid() stays that way. * -* Nests above zone->lock and zone->size_seqlock. +* Nests above zone->lock and zone->span_seqlock */ spinlock_t node_size_lock;#endif
Signature · 7 lines
1.8.2.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH v2 1/4] mm: fix comment referring to non-existent size_seqlock, change to span_seqlock
Quoted 1 line · Cody P Schafer
Signed-off-by Cody P Schafer <[email protected]>
Others in this series aren't needed, in my opinion, but everybody has their own tastes.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 2/4 mmzone: note that node_size_lock should be manipulated via pgdat_resize_lock()
In reply to Cody P Schafer--- include/linux/mmzone.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/mmzone.h +3 -0
@@ -716,6 +716,9 @@ typedef struct pglist_data {* or node_spanned_pages stay constant. Holding this will also * guarantee that any pfn_valid() stays that way. * +* pgdat_resize_lock() and pgdat_resize_unlock() are provided to +* manipulate node_size_lock without checking for CONFIG_MEMORY_HOTPLUG. +* * Nests above zone->lock and zone->span_seqlock */ spinlock_t node_size_lock;
Signature · 7 lines
1.8.2.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 3/4 memory_hotplug: use pgdat_resize_lock() in online_pages()
In reply to Cody P Schafermmzone.h documents node_size_lock (which pgdat_resize_lock() locks) as guarding against changes to node_present_pages, so actually lock it when we update node_present_pages to keep that promise.
--- mm/memory_hotplug.c | 5 +++++ 1 file changed, 5 insertions(+)
mm/memory_hotplug.c +5 -0
@@ -915,6 +915,7 @@ static void node_states_set_node(int node, struct memory_notify *arg)int __ref online_pages (unsigned long pfn,unsigned long nr_pages,int online_type) { +unsigned long flags;unsigned long onlined_pages =0 ;struct zone *zone;int need_zonelists_rebuild =0 ;
@@ -993,7 +994,11 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ zone->managed_pages += onlined_pages; zone->present_pages += onlined_pages; + +pgdat_resize_lock (zone->zone_pgdat, &flags); zone->zone_pgdat->node_present_pages += onlined_pages; +pgdat_resize_unlock (zone->zone_pgdat, &flags); +if (onlined_pages) {node_states_set_node (zone_to_nid (zone), &arg);if (need_zonelists_rebuild)
Signature · 7 lines
1.8.2.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 4/4 memory_hotplug: use pgdat_resize_lock() in __offline_pages()
In reply to Cody P Schafermmzone.h documents node_size_lock (which pgdat_resize_lock() locks) as guarding against changes to node_present_pages, so actually lock it when we update node_present_pages to keep that promise.
--- mm/memory_hotplug.c | 4 ++++ 1 file changed, 4 insertions(+)
mm/memory_hotplug.c +4 -0
@@ -1582,7 +1582,11 @@ repeat:/* removal success */ zone->managed_pages -= offlined_pages; zone->present_pages -= offlined_pages; + +pgdat_resize_lock (zone->zone_pgdat, &flags); zone->zone_pgdat->node_present_pages -= offlined_pages; +pgdat_resize_unlock (zone->zone_pgdat, &flags); + totalram_pages -= offlined_pages;init_per_zone_wmark_min ();
Signature · 7 lines
1.8.2.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>