Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933214AbZGPUFq (ORCPT ); Thu, 16 Jul 2009 16:05:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932901AbZGPUFq (ORCPT ); Thu, 16 Jul 2009 16:05:46 -0400 Received: from smtp-out.google.com ([216.239.33.17]:46608 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932765AbZGPUFp (ORCPT ); Thu, 16 Jul 2009 16:05:45 -0400 DomainKey-Signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id: references:user-agent:mime-version:content-type:x-system-of-record; b=wZvTnaXTP+7VOy/ppSsMsaYI7cNsYKz/b28pmCC++FqhtudkaR9Ry96cQjCsXgJYj 0YT58NMALP353A3igOXPw== Date: Thu, 16 Jul 2009 13:05:31 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Lee Schermerhorn cc: KOSAKI Motohiro , Miao Xie , Ingo Molnar , Peter Zijlstra , Christoph Lameter , Paul Menage , Nick Piggin , Yasunori Goto , Pekka Enberg , linux-mm , LKML , Andrew Morton Subject: Re: [BUG] set_mempolicy(MPOL_INTERLEAV) cause kernel panic In-Reply-To: <1247679064.4089.26.camel@useless.americas.hpqcorp.net> Message-ID: References: <20090715182320.39B5.A69D9226@jp.fujitsu.com> <1247679064.4089.26.camel@useless.americas.hpqcorp.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2076 Lines: 56 On Wed, 15 Jul 2009, Lee Schermerhorn wrote: > Interestingly, on ia64, the top cpuset mems_allowed gets set to all > possible nodes, while on x86_64, it gets set to on-line nodes [or nodes > with memory]. Maybe this is a to support hot-plug? > numactl --interleave=all simply passes a nodemask with all bits set, so if cpuset_current_mems_allowed includes offline nodes from node_possible_map, then mpol_set_nodemask() doesn't mask them off. Seems like we could handle this strictly in mempolicies without worrying about top_cpuset like in the following? --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -194,6 +194,7 @@ static int mpol_new_bind(struct mempolicy *pol, const nodemask_t *nodes) static int mpol_set_nodemask(struct mempolicy *pol, const nodemask_t *nodes) { nodemask_t cpuset_context_nmask; + nodemask_t mems_allowed; int ret; /* if mode is MPOL_DEFAULT, pol is NULL. This is right. */ @@ -201,20 +202,21 @@ static int mpol_set_nodemask(struct mempolicy *pol, const nodemask_t *nodes) return 0; VM_BUG_ON(!nodes); + nodes_and(mems_allowed, cpuset_current_mems_allowed, + node_states[N_HIGH_MEMORY]); if (pol->mode == MPOL_PREFERRED && nodes_empty(*nodes)) nodes = NULL; /* explicit local allocation */ else { if (pol->flags & MPOL_F_RELATIVE_NODES) mpol_relative_nodemask(&cpuset_context_nmask, nodes, - &cpuset_current_mems_allowed); + &mems_allowed); else nodes_and(cpuset_context_nmask, *nodes, - cpuset_current_mems_allowed); + mems_allowed); if (mpol_store_user_nodemask(pol)) pol->w.user_nodemask = *nodes; else - pol->w.cpuset_mems_allowed = - cpuset_current_mems_allowed; + pol->w.cpuset_mems_allowed = mems_allowed; } ret = mpol_ops[pol->mode].create(pol, -- 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/