From patchwork Tue Sep 9 19:06:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Aravamudan X-Patchwork-Id: 387428 X-Patchwork-Delegate: michael@ellerman.id.au Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8D96D140187 for ; Wed, 10 Sep 2014 05:10:47 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id 555D01A1728 for ; Wed, 10 Sep 2014 05:10:47 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 36B791A0B6B for ; Wed, 10 Sep 2014 05:06:49 +1000 (EST) Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Sep 2014 13:06:46 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 9 Sep 2014 13:06:44 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 229BF3E40047 for ; Tue, 9 Sep 2014 13:06:44 -0600 (MDT) Received: from d03av01.ahe.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s89J6iZR25821190 for ; Tue, 9 Sep 2014 21:06:44 +0200 Received: from d03av01.ahe.boulder.ibm.com (localhost [127.0.0.1]) by d03av01.ahe.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s89J6d1e006710 for ; Tue, 9 Sep 2014 13:06:43 -0600 Received: from qbert.localdomain ([9.80.104.72]) by d03av01.ahe.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s89J6aOl006254; Tue, 9 Sep 2014 13:06:36 -0600 Received: by qbert.localdomain (Postfix, from userid 1000) id D76EB48026B; Tue, 9 Sep 2014 12:06:30 -0700 (PDT) Date: Tue, 9 Sep 2014 12:06:30 -0700 From: Nishanth Aravamudan To: Andrew Morton Subject: [PATCH 3/3] Partial revert of 81c98869faa5 ("kthread: ensure locality of task_struct allocations") Message-ID: <20140909190630.GF22906@linux.vnet.ibm.com> References: <20140909190154.GC22906@linux.vnet.ibm.com> <20140909190326.GD22906@linux.vnet.ibm.com> <20140909190514.GE22906@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140909190514.GE22906@linux.vnet.ibm.com> X-Operating-System: Linux 3.13.0-35-generic (x86_64) User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14090919-0928-0000-0000-000004B0FB9C Cc: Han Pingtian , Matt Mackall , David Rientjes , Pekka Enberg , Linux Memory Management List , Paul Mackerras , Tejun Heo , Joonsoo Kim , linuxppc-dev@lists.ozlabs.org, Christoph Lameter , Wanpeng Li , Anton Blanchard X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" After discussions with Tejun, we don't want to spread the use of cpu_to_mem() (and thus knowledge of allocators/NUMA topology details) into callers, but would rather ensure the callees correctly handle memoryless nodes. With the previous patches ("topology: add support for node_to_mem_node() to determine the fallback node" and "slub: fallback to node_to_mem_node() node if allocating on memoryless node") adding and using node_to_mem_node(), we can safely undo part of the change to the kthread logic from 81c98869faa5. Signed-off-by: Nishanth Aravamudan diff --git a/kernel/kthread.c b/kernel/kthread.c index ef483220e855..10e489c448fe 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -369,7 +369,7 @@ struct task_struct *kthread_create_on_cpu(int (*threadfn)(void *data), { struct task_struct *p; - p = kthread_create_on_node(threadfn, data, cpu_to_mem(cpu), namefmt, + p = kthread_create_on_node(threadfn, data, cpu_to_node(cpu), namefmt, cpu); if (IS_ERR(p)) return p;