linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred
@ 2012-06-20  1:39 Gavin Shan
  2012-06-20  1:39 ` [PATCH RESEND 2/2] mm/buddy: get the allownodes for dump at once Gavin Shan
  2012-06-21  1:25 ` [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred David Rientjes
  0 siblings, 2 replies; 4+ messages in thread
From: Gavin Shan @ 2012-06-20  1:39 UTC (permalink / raw)
  To: linux-mm; +Cc: rientjes, hannes, minchan, akpm, Gavin Shan

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.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
---
 include/linux/compaction.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 51a90b7..133ddcf 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -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 */
-- 
1.7.9.5

--
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 related	[flat|nested] 4+ messages in thread

* [PATCH RESEND 2/2] mm/buddy: get the allownodes for dump at once
  2012-06-20  1:39 [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred Gavin Shan
@ 2012-06-20  1:39 ` Gavin Shan
  2012-06-21  1:25 ` [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred David Rientjes
  1 sibling, 0 replies; 4+ messages in thread
From: Gavin Shan @ 2012-06-20  1:39 UTC (permalink / raw)
  To: linux-mm; +Cc: rientjes, hannes, minchan, akpm, Gavin Shan

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.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---
 mm/page_alloc.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7892f84..211004e 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -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);
-- 
1.7.9.5

--
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 related	[flat|nested] 4+ messages in thread

* Re: [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred
  2012-06-20  1:39 [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred Gavin Shan
  2012-06-20  1:39 ` [PATCH RESEND 2/2] mm/buddy: get the allownodes for dump at once Gavin Shan
@ 2012-06-21  1:25 ` David Rientjes
  2012-06-21  3:06   ` Gavin Shan
  1 sibling, 1 reply; 4+ messages in thread
From: David Rientjes @ 2012-06-21  1:25 UTC (permalink / raw)
  To: Gavin Shan; +Cc: linux-mm, hannes, minchan, akpm

On Wed, 20 Jun 2012, Gavin Shan wrote:

> 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.
> 
> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
> Acked-by: Minchan Kim <minchan@kernel.org>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Acked-by: David Rientjes <rientjes@google.com>

--
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] 4+ messages in thread

* Re: [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred
  2012-06-21  1:25 ` [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred David Rientjes
@ 2012-06-21  3:06   ` Gavin Shan
  0 siblings, 0 replies; 4+ messages in thread
From: Gavin Shan @ 2012-06-21  3:06 UTC (permalink / raw)
  To: David Rientjes; +Cc: Gavin Shan, linux-mm, hannes, minchan, akpm

>> 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.
>> 
>> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
>> Acked-by: Minchan Kim <minchan@kernel.org>
>> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
>
>Acked-by: David Rientjes <rientjes@google.com>
>

Thanks, David :-)

Thanks,
Gavin

--
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] 4+ messages in thread

end of thread, other threads:[~2012-06-21  3:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20  1:39 [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred Gavin Shan
2012-06-20  1:39 ` [PATCH RESEND 2/2] mm/buddy: get the allownodes for dump at once Gavin Shan
2012-06-21  1:25 ` [PATCH RESEND 1/2] mm/compaction: cleanup on compaction_deferred David Rientjes
2012-06-21  3:06   ` Gavin Shan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).