From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx177.postini.com [74.125.245.177]) by kanga.kvack.org (Postfix) with SMTP id 8F6136B0068 for ; Thu, 11 Oct 2012 11:53:06 -0400 (EDT) Date: Thu, 11 Oct 2012 16:53:02 +0100 From: Mel Gorman Subject: Re: [PATCH 15/33] autonuma: alloc/free/init task_autonuma Message-ID: <20121011155302.GA3317@csn.ul.ie> References: <1349308275-2174-1-git-send-email-aarcange@redhat.com> <1349308275-2174-16-git-send-email-aarcange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1349308275-2174-16-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, Linus Torvalds , Andrew Morton , Peter Zijlstra , Ingo Molnar , Hugh Dickins , Rik van Riel , Johannes Weiner , Hillf Danton , Andrew Jones , Dan Smith , Thomas Gleixner , Paul Turner , Christoph Lameter , Suresh Siddha , Mike Galbraith , "Paul E. McKenney" , Lai Jiangshan , Bharata B Rao , Lee Schermerhorn , Srivatsa Vaddagiri , Alex Shi , Mauricio Faria de Oliveira , Konrad Rzeszutek Wilk , Don Morris , Benjamin Herrenschmidt On Thu, Oct 04, 2012 at 01:50:57AM +0200, Andrea Arcangeli wrote: > This is where the dynamically allocated task_autonuma structure is > being handled. > > This is the structure holding the per-thread NUMA statistics generated > by the NUMA hinting page faults. This per-thread NUMA statistical > information is needed by sched_autonuma_balance to make optimal NUMA > balancing decisions. > > It also contains the task_selected_nid which hints the stock CPU > scheduler on the best NUMA node to schedule this thread on (as decided > by sched_autonuma_balance). > > 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 non NUMA hardware only pays the memory of a pointer > in the kernel stack (which remains NULL at all times in that case). > > If the kernel is compiled with CONFIG_AUTONUMA=n, not even the pointer > is allocated on the kernel stack of course. > > Signed-off-by: Andrea Arcangeli There is a possibility that someone will complain about the extra kmalloc() during fork that is now necessary for the autonuma structure. Microbenchmarks will howl but who cares -- autonuma only makes sense for long-lived processes anyway. It may be necessary in the future to defer this allocation until the process has consumed a few CPU seconds and likely to hang around for a while. Overkill for now though so Acked-by: Mel Gorman -- Mel Gorman SUSE Labs -- 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