Re: [PATCH v2] mm/compaction : fix the wrong return value for isolate_migratepages()
From: Mel Gorman <mgorman@suse.de>
Date: 2012-01-05 10:12:27
On Sat, Dec 31, 2011 at 05:09:45PM +0800, Huang Shijie wrote:
When we do not get any migrate page, we should return ISOLATE_NONE.
Why?
Returning ISOLATE_SUCCESS means that we fall through. This means busy
work in migrate_pages(), updating list accounting and the list. It's
wasteful but is it functionally incorrect? What problem did you observe?
If this is simply a performance issue then minimally COMPACTBLOCKS
still needs to be updated, we still want to see the tracepoint etc. To
preserve that, I would suggest as an alternative to leave it returning
ISOLATE_SUCCESS but move
err = migrate_pages(&cc->migratepages, compaction_alloc,
(unsigned long)cc, false,
cc->sync ? MIGRATE_SYNC_LIGHT : MIGRATE_ASYNC);
update_nr_listpages(cc);
inside a if (nr_migrate) check to avoid some overhead.
--
Mel Gorman
SUSE Labs
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>