mm/compaction: cleanup on compaction_deferred
Subsystems (2)
PATCH RESEND 1/2 mm/compaction: cleanup on compaction_deferred
When CONFIG_COMPACTION is enabled, compaction_deferred() tries to recalculate the deferred limit again, which isn't necessary.
When CONFIG_COMPACTION is disabled, compaction_deferred() should return "true" or "false" since it has "bool" for its return value.
--- include/linux/compaction.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/compaction.h +2 -2
@@ -58,7 +58,7 @@ static inline bool compaction_deferred(struct zone *zone, int order)if (++zone->compact_considered > defer_limit) zone->compact_considered = defer_limit; - return zone->compact_considered < (1UL << zone->compact_defer_shift); + return zone->compact_considered < defer_limit; }#else
@@ -85,7 +85,7 @@ static inline void defer_compaction(struct zone *zone, int order)static inline bool compaction_deferred (struct zone *zone,int order) { -return 1 ; +return true; }#endif /* CONFIG_COMPACTION */
Signature · 7 lines
1.7.9.5 -- 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 RESEND 2/2 mm/buddy: get the allownodes for dump at once
When dumping the statistics for zones in the allowed nodes in the function show_free_areas(), skip_free_areas_node() got called for multiple times to figure out the same information: the allowed nodes for dump. It's reasonable to get the allowed nodes at once. That will also help to get consistent dump information.
--- mm/page_alloc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
mm/page_alloc.c +12 -4
@@ -2765,11 +2765,19 @@ out:*/ void show_free_areas (unsigned int filter) { -int cpu; +int nid, cpu; +nodemask_t allownodes;struct zone *zone; +/* Figure out the allowed nodes for dump */ +nodes_clear (allownodes); +for_each_online_node (nid) { +if (!skip_free_areas_node (filter, nid)) +node_set (nid, allownodes); + } +for_each_populated_zone (zone) { -if (skip_free_areas_node (filter,zone_to_nid (zone))) +if (!node_isset (zone_to_nid (zone), allownodes))continue ;show_node (zone);printk ("%s per-cpu:\n" , zone->name);
@@ -2812,7 +2820,7 @@ void show_free_areas(unsigned int filter)for_each_populated_zone (zone) {int i; -if (skip_free_areas_node (filter,zone_to_nid (zone))) +if (!node_isset (zone_to_nid (zone), allownodes))continue ;show_node (zone); printk("%s"
@@ -2881,7 +2889,7 @@ void show_free_areas(unsigned int filter)for_each_populated_zone (zone) {unsigned long nr[MAX_ORDER ], flags, order, total =0 ; -if (skip_free_areas_node (filter,zone_to_nid (zone))) +if (!node_isset (zone_to_nid (zone), allownodes))continue ;show_node (zone);printk ("%s: " , zone->name);
Signature · 7 lines
1.7.9.5 -- 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>
Quoted 9 lines · Gavin Shan
When
CONFIG_COMPACTIONis enabled,compaction_deferred()tries to recalculate the deferred limit again, which isn't necessary.When
CONFIG_COMPACTIONis disabled,compaction_deferred()should return "true" or "false" since it has "bool" for its return value.Signed-off-by Gavin Shan <[email protected]>Acked-by Minchan Kim <[email protected]>Acked-by Johannes Weiner <[email protected]>
--
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>
Quoted 12 lines
Quoted 9 lines
When
CONFIG_COMPACTIONis enabled,compaction_deferred()tries to recalculate the deferred limit again, which isn't necessary.When
CONFIG_COMPACTIONis disabled,compaction_deferred()should return "true" or "false" since it has "bool" for its return value.Signed-off-by Gavin Shan <[email protected]>Acked-by Minchan Kim <[email protected]>Acked-by Johannes Weiner <[email protected]>Acked-by David Rientjes <[email protected]>
Thanks, David :-)
Thanks,
Gavin
--
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>