mm: compaction: abort compaction if too many pages are isolated and caller is asynchr...
commit3c84cb1e00ef95da040d93b92ae00e16c3b2dabc
authorMel Gorman <mgorman@suse.de>
Tue, 19 Jul 2011 09:15:51 +0000 (19 10:15 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 3 Aug 2011 19:42:44 +0000 (3 12:42 -0700)
tree69a40a1648a976699e211536cb8e7a2114e601eb
parentacd640b8cf7e3a9e554a0ceadb2f73516c09256f
mm: compaction: abort compaction if too many pages are isolated and caller is asynchronous V2

commit: f9e35b3b41f47c4e17d8132edbcab305a6aaa4b0 upstream

Asynchronous compaction is used when promoting to huge pages.  This is all
very nice but if there are a number of processes in compacting memory, a
large number of pages can be isolated.  An "asynchronous" process can
stall for long periods of time as a result with a user reporting that
firefox can stall for 10s of seconds.  This patch aborts asynchronous
compaction if too many pages are isolated as it's better to fail a
hugepage promotion than stall a process.

[minchan.kim@gmail.com: return COMPACT_PARTIAL for abort]
Reported-and-tested-by: Ury Stankevich <urykhy@gmail.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/compaction.c