Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753667Ab2FYE7f (ORCPT ); Mon, 25 Jun 2012 00:59:35 -0400 Received: from LGEMRELSE1Q.lge.com ([156.147.1.111]:50487 "EHLO LGEMRELSE1Q.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791Ab2FYE7e (ORCPT ); Mon, 25 Jun 2012 00:59:34 -0400 X-AuditID: 9c93016f-b7cbdae0000024ac-18-4fe7f030b5d1 From: Minchan Kim To: akpm@linux-foundation.org Cc: KOSAKI Motohiro , Mel Gorman , KAMEZAWA Hiroyuki , Aaditya Kumar , LKML , linux-mm , Minchan Kim Subject: [PATCH 0/2] fix livelock because of kswapd stop Date: Mon, 25 Jun 2012 13:59:25 +0900 Message-Id: <1340600367-23620-1-git-send-email-minchan@kernel.org> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: AAAAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 51 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 | 107 +++++++++++++------------------------- mm/page_isolation.c | 110 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 166 insertions(+), 77 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/