From: Minchan Kim <minchan@kernel.org>
To: akpm@linux-foundation.org
Cc: KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Mel Gorman <mel@csn.ul.ie>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Aaditya Kumar <aaditya.kumar.30@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-mm <linux-mm@kvack.org>, Minchan Kim <minchan@kernel.org>
Subject: [PATCH 0/2 v2] fix livelock because of kswapd stop
Date: Wed, 27 Jun 2012 16:51:52 +0900 [thread overview]
Message-ID: <1340783514-8150-1-git-send-email-minchan@kernel.org> (raw)
When hotplug offlining happens on zone A, it starts to mark freed page
as MIGRATE_ISOLATE type in buddy for preventing further allocation.
(MIGRATE_ISOLATE is very irony type because it's apparently on buddy
but we can't allocate them).
When the memory shortage happens during hotplug offlining,
current task starts to reclaim, then wake up kswapd.
Kswapd checks watermark, then go sleep because current zone_watermark_ok_safe
doesn't consider MIGRATE_ISOLATE freed page count.
Current task continue to reclaim in direct reclaim path without kswapd's helping.
The problem is that zone->all_unreclaimable is set by only kswapd
so that current task would be looping forever like below.
__alloc_pages_slowpath
restart:
wake_all_kswapd
rebalance:
__alloc_pages_direct_reclaim
do_try_to_free_pages
if global_reclaim && !all_unreclaimable
return 1; /* It means we did did_some_progress */
skip __alloc_pages_may_oom
should_alloc_retry
goto rebalance;
[1/2] factor out memory-isolation functions from page_alloc.c to mm/page_isolation.c
This patch can be merged regardless of [2/2].
[2/2] fix this problem.
Aaditya, Could you confirm this patch can solve your problem?
Minchan Kim (2):
mm: Factor out memory isolate functions
memory-hotplug: fix kswapd looping forever problem
drivers/base/Kconfig | 1 +
include/linux/mmzone.h | 8 ++++
include/linux/page-isolation.h | 8 ++--
mm/Kconfig | 5 ++
mm/Makefile | 4 +-
mm/page_alloc.c | 102 ++++++++++++----------------------------
mm/page_isolation.c | 96 +++++++++++++++++++++++++++++++++++++
7 files changed, 147 insertions(+), 77 deletions(-)
--
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>
next reply other threads:[~2012-06-27 7:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 7:51 Minchan Kim [this message]
2012-06-27 7:51 ` [PATCH 1/2 v2] mm: Factor out memory isolate functions Minchan Kim
2012-06-28 7:11 ` Kamezawa Hiroyuki
2012-06-27 7:51 ` [PATCH 2/2 v2] memory-hotplug: fix kswapd looping forever problem Minchan Kim
2012-06-28 7:13 ` Kamezawa Hiroyuki
2012-06-28 23:34 ` Minchan Kim
2012-07-09 13:31 ` Aaditya Kumar
2012-07-09 14:29 ` Minchan Kim
2012-07-10 5:35 ` Aaditya Kumar
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=1340783514-8150-1-git-send-email-minchan@kernel.org \
--to=minchan@kernel.org \
--cc=aaditya.kumar.30@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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).