Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934535Ab2JXJmQ (ORCPT ); Wed, 24 Oct 2012 05:42:16 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:22815 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S934499Ab2JXJmM (ORCPT ); Wed, 24 Oct 2012 05:42:12 -0400 X-IronPort-AV: E=Sophos;i="4.80,639,1344182400"; d="scan'208";a="6060160" From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: Lai Jiangshan , David Rientjes , Minchan Kim , KOSAKI Motohiro , Yasuaki Ishimatsu , Rob Landley , Andrew Morton , Jiang Liu , Kay Sievers , Greg Kroah-Hartman , Mel Gorman , "'FNST-Wen Congyang'" , linux-doc@vger.kernel.org, linux-mm@kvack.org, Christoph Lameter , Pekka Enberg , Matt Mackall Subject: [PATCH 2/2 V2] slub, hotplug: ignore unrelated node's hot-adding and hot-removing Date: Wed, 24 Oct 2012 17:43:52 +0800 Message-Id: <1351071840-5060-3-git-send-email-laijs@cn.fujitsu.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1351071840-5060-1-git-send-email-laijs@cn.fujitsu.com> References: <1351071840-5060-1-git-send-email-laijs@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/24 17:41:37, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/10/24 17:41:38, Serialize complete at 2012/10/24 17:41:38 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2550 Lines: 69 SLUB only fucus on the nodes which has normal memory, so ignore the other node's hot-adding and hot-removing. Aka: if some memroy of a node(which has no onlined memory) is online, but this new memory onlined is not normal memory(HIGH memory example), we should not allocate kmem_cache_node for SLUB. And if the last normal memory is offlined, but the node still has memroy, we should remove kmem_cache_node for that node.(current code delay it when all of the memory is offlined) so we only do something when marg->status_change_nid_normal > 0. marg->status_change_nid is not suitable here. The same problem doesn't exsit in SLAB, because SLAB allocates kmem_list3 for every node even the node don't have normal memory, SLAB tolerates kmem_list3 on alien nodes. SLUB only fucus on the nodes which has normal memory, it don't tolerates alien kmem_cache_node, the patch makes SLUB become self-compatible and avoid WARN and BUG in a rare condition. CC: David Rientjes Cc: Minchan Kim CC: KOSAKI Motohiro CC: Yasuaki Ishimatsu CC: Rob Landley CC: Andrew Morton CC: Jiang Liu CC: Kay Sievers CC: Greg Kroah-Hartman CC: Mel Gorman CC: 'FNST-Wen Congyang' CC: linux-doc@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: linux-mm@kvack.org Signed-off-by: Lai Jiangshan --- mm/slub.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index a0d6984..487f0bd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3573,7 +3573,7 @@ static void slab_mem_offline_callback(void *arg) struct memory_notify *marg = arg; int offline_node; - offline_node = marg->status_change_nid; + offline_node = marg->status_change_nid_normal; /* * If the node still has available memory. we need kmem_cache_node @@ -3606,7 +3606,7 @@ static int slab_mem_going_online_callback(void *arg) struct kmem_cache_node *n; struct kmem_cache *s; struct memory_notify *marg = arg; - int nid = marg->status_change_nid; + int nid = marg->status_change_nid_normal; int ret = 0; /* -- 1.7.4.4 -- 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/