Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932973AbbGJRez (ORCPT ); Fri, 10 Jul 2015 13:34:55 -0400 Received: from relay2.sgi.com ([192.48.180.65]:40748 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754548AbbGJRes (ORCPT ); Fri, 10 Jul 2015 13:34:48 -0400 Date: Fri, 10 Jul 2015 12:34:45 -0500 From: Nathan Zimmer To: Andrew Morton Cc: Nathan Zimmer , Nishanth Aravamudan , Tejun Heo , Lai Jiangshan , Mel Gorman , linux-kernel@vger.kernel.org, Eric Dumazet Subject: Re: [RFC] kthread_create_on_node is failing to honor the node choice Message-ID: <20150710173445.GA39511@asylum.americas.sgi.com> References: <20150625204855.GC26927@suse.de> <1435268653-167841-1-git-send-email-nzimmer@sgi.com> <20150709151259.2ce6a8882d0c98ae77528667@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709151259.2ce6a8882d0c98ae77528667@linux-foundation.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 39 On Thu, Jul 09, 2015 at 03:12:59PM -0700, Andrew Morton wrote: > On Thu, 25 Jun 2015 16:44:13 -0500 Nathan Zimmer wrote: > > > In kthread_create_on_node we set_cpus_allowed to cpu_all_mask > > regardless of what the node is requested. > > This seems incorrect. > > The `node' arg to kthread_create_on_node() refers to which node the > task_struct and thread_info are allocated from. It doesn't refer to > the CPUs upon which the thread is executed. See > kthread_create_info.node and that gruesome task_struct.pref_node_fork > thing. > > The kthread_create_on_node() kerneldoc explains this, in a confused > way. It needs a s/-1/NUMA_NO_NODE/. I suspect we should also update the kthread_create macro to use NUMA_NO_NODE also. diff --git a/include/linux/kthread.h b/include/linux/kthread.h index 13d5520..3e6773e 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h @@ -11,7 +11,7 @@ struct task_struct *kthread_create_on_node(int (*threadfn)(void *data), const char namefmt[], ...); #define kthread_create(threadfn, data, namefmt, arg...) \ - kthread_create_on_node(threadfn, data, -1, namefmt, ##arg) + kthread_create_on_node(threadfn, data, NUMA_NO_NODE, namefmt, ##arg) struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), -- 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/