From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751640Ab2F3FKI (ORCPT ); Sat, 30 Jun 2012 01:10:08 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:39670 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750909Ab2F3FKF (ORCPT ); Sat, 30 Jun 2012 01:10:05 -0400 Date: Sat, 30 Jun 2012 01:10:01 -0400 From: Konrad Rzeszutek Wilk To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt Subject: Re: [PATCH 19/40] autonuma: alloc/free/init sched_autonuma Message-ID: <20120630051000.GF3975@localhost.localdomain> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> <1340888180-15355-20-git-send-email-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1340888180-15355-20-git-send-email-aarcange@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 28, 2012 at 02:55:59PM +0200, Andrea Arcangeli wrote: > This is where the dynamically allocated sched_autonuma structure is > being handled. > > The reason for keeping this outside of the task_struct besides not > using too much kernel stack, is to only allocate it on NUMA > hardware. So the not NUMA hardware only pays the memory of a pointer > in the kernel stack (which remains NULL at all times in that case). .. snip.. > + if (unlikely(alloc_task_autonuma(tsk, orig, node))) > + /* free_thread_info() undoes arch_dup_task_struct() too */ > + goto out_thread_info; > That looks (without seeing the implementation) and from reading the git commit, like that on non-NUMA machines it would fail - and end up stop the creation of a task. Perhaps a better name for the function: alloc_always_task_autonuma since the function (at least from the description of this patch) will always succeed. Perhaps even remove the: "if unlikely(..)" bit? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx207.postini.com [74.125.245.207]) by kanga.kvack.org (Postfix) with SMTP id 247FF6B0074 for ; Sat, 30 Jun 2012 01:10:06 -0400 (EDT) Received: by qcsd16 with SMTP id d16so2387671qcs.14 for ; Fri, 29 Jun 2012 22:10:05 -0700 (PDT) Date: Sat, 30 Jun 2012 01:10:01 -0400 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 19/40] autonuma: alloc/free/init sched_autonuma Message-ID: <20120630051000.GF3975@localhost.localdomain> References: <1340888180-15355-1-git-send-email-aarcange@redhat.com> <1340888180-15355-20-git-send-email-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1340888180-15355-20-git-send-email-aarcange@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Andrea Arcangeli Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Hillf Danton , Dan Smith , Peter Zijlstra , Linus Torvalds , Andrew Morton , Thomas Gleixner , Ingo Molnar , Paul Turner , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Rik van Riel , Johannes Weiner , Srivatsa Vaddagiri , Christoph Lameter , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt On Thu, Jun 28, 2012 at 02:55:59PM +0200, Andrea Arcangeli wrote: > This is where the dynamically allocated sched_autonuma structure is > being handled. > > The reason for keeping this outside of the task_struct besides not > using too much kernel stack, is to only allocate it on NUMA > hardware. So the not NUMA hardware only pays the memory of a pointer > in the kernel stack (which remains NULL at all times in that case). .. snip.. > + if (unlikely(alloc_task_autonuma(tsk, orig, node))) > + /* free_thread_info() undoes arch_dup_task_struct() too */ > + goto out_thread_info; > That looks (without seeing the implementation) and from reading the git commit, like that on non-NUMA machines it would fail - and end up stop the creation of a task. Perhaps a better name for the function: alloc_always_task_autonuma since the function (at least from the description of this patch) will always succeed. Perhaps even remove the: "if unlikely(..)" bit? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org