linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mel Gorman <mgorman@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Hillf Danton <dhillf@gmail.com>, Minchan Kim <minchan@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: [PATCH] mm: compaction: Do not compact pgdat for order-0
Date: Thu, 15 Aug 2013 16:39:27 +0100	[thread overview]
Message-ID: <20130815153927.GZ2296@suse.de> (raw)
In-Reply-To: <20130815141004.GD8437@gmail.com>

If kswapd was reclaiming for a high order and resets it to 0 due to
fragmentation it will still call compact_pgdat. For the most part, this will
fail a compaction_suitable() test and not compact but it is unnecessarily
sloppy. It could be fixed in the caller but fix it in the API instead.

[dhillf@gmail.com: Pointed out that it was a potential problem]
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
 mm/compaction.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index 05ccb4c..c437893 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1131,6 +1131,9 @@ void compact_pgdat(pg_data_t *pgdat, int order)
 		.sync = false,
 	};
 
+	if (!order)
+		return;
+
 	__compact_pgdat(pgdat, &cc);
 }
 

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

  reply	other threads:[~2013-08-15 15:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 10:02 kswapd skips compaction if reclaim order drops to zero? Hillf Danton
2013-08-15 10:47 ` Mel Gorman
2013-08-15 13:41   ` Minchan Kim
2013-08-15 13:56     ` Mel Gorman
2013-08-15 14:10       ` Minchan Kim
2013-08-15 15:39         ` Mel Gorman [this message]
2013-08-16  4:37           ` [PATCH] mm: compaction: Do not compact pgdat for order-0 Minchan Kim
2013-08-16  0:25         ` kswapd skips compaction if reclaim order drops to zero? Wanpeng Li
2013-08-16  0:25         ` Wanpeng Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130815153927.GZ2296@suse.de \
    --to=mgorman@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=dhillf@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).