public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Don Morris <don.morris@hp.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Tim Chen <tim.c.chen@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrea Arcangeli <aarcange@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <pzijlstr@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Mel Gorman <mel@csn.ul.ie>, Hugh Dickins <hughd@google.com>,
	Rik van Riel <riel@redhat.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Hillf Danton <dhillf@gmail.com>,
	Andrew Jones <drjones@redhat.com>, Dan Smith <danms@us.ibm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul Turner <pjt@google.com>, Christoph Lameter <cl@linux.com>,
	Suresh Siddha <suresh.b.siddha@intel.com>,
	Mike Galbraith <efault@gmx.de>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Lai Jiangshan <laijs@cn.fujitsu.com>,
	Bharata B Rao <bharata.rao@gmail.com>,
	Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>,
	Alex@linux.intel.com, Sh@linux.intel.com
Subject: Re: [PATCH 00/33] AutoNUMA27
Date: Mon, 08 Oct 2012 06:44:44 -0700	[thread overview]
Message-ID: <5072D8CC.6020705@hp.com> (raw)
In-Reply-To: <m2zk40v4qy.fsf@firstfloor.org>

On 10/05/2012 05:11 PM, Andi Kleen wrote:
> Tim Chen <tim.c.chen@linux.intel.com> writes:
>>>
>>
>> I remembered that 3 months ago when Alex tested the numa/sched patches
>> there were 20% regression on SpecJbb2005 due to the numa balancer.
> 
> 20% on anything sounds like a show stopper to me.
> 
> -Andi
> 

Much worse than that on an 8-way machine for a multi-node multi-threaded
process, from what I can tell. (Andrea's AutoNUMA microbenchmark is a
simple version of that). The contention on the page table lock
( &(&mm->page_table_lock)->rlock ) goes through the roof, with threads
constantly fighting to invalidate translations and re-fault them.

This is on a DL980 with Xeon E7-2870s @ 2.4 GHz, btw.

Running linux-next with no tweaks other than
kernel.sched_migration_cost_ns = 500000 gives:
numa01
8325.78
numa01_HARD_BIND
488.98

(The Hard Bind being a case where the threads are pre-bound to the
node set with their memory, so what should be a fairly "best case" for
comparison).

If the SchedNUMA scanning period is upped to 25000 ms (to keep repeated
invalidations from being triggered while the contention for the first
invalidation pass is still being fought over):
numa01
4272.93
numa01_HARD_BIND
498.98

Since this is a "big" process in the current SchedNUMA code and hence
much more likely to trip invalidations, forcing task_numa_big() to
always return false in order to avoid the frequent invalidations gives:
numa01
429.07
numa01_HARD_BIND
466.67

Finally, with SchedNUMA entirely disabled but the rest of linux-next
left intact:
numa01
1075.31
numa01_HARD_BIND
484.20

I didn't write down the lock contentions for comparison, but yes -
the contention does decrease similarly to the time decreases.

There are other microbenchmarks, but those suffice to show the
regression pattern. I mentioned this to the RedHat folks last
week, so I expect this is already being worked. It seemed pertinent
to bring up given the discussion about the current state of linux-next
though, just so folks know. From where I'm sitting, it looks to
me like the scan period is way too aggressive and there's too much
work potentially attempted during a "scan" (by which I mean the
hard tick driven choice to invalidate in order to set up potential
migration faults). The current code walks/invalidates the entire
virtual address space, skipping few vmas. For a very large 64-bit
process, that's going to be a *lot* of translations (or even vmas
if the address space is fragmented) to walk. That's a seriously
long path coming from the timer code. I would think capping the
number of translations to process per visit would help.

Hope this helps the discussion,
Don Morris


  reply	other threads:[~2012-10-08 13:56 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1349308275-2174-1-git-send-email-aarcange@redhat.com>
     [not found] ` <20121004113943.be7f92a0.akpm@linux-foundation.org>
2012-10-05 23:14   ` [PATCH 00/33] AutoNUMA27 Andi Kleen
2012-10-05 23:57     ` Tim Chen
2012-10-06  0:11       ` Andi Kleen
2012-10-08 13:44         ` Don Morris [this message]
2012-10-08 20:34     ` Rik van Riel
     [not found] ` <20121011101930.GM3317@csn.ul.ie>
2012-10-11 14:56   ` Andrea Arcangeli
2012-10-11 15:35     ` Mel Gorman
2012-10-12  0:41       ` Andrea Arcangeli
2012-10-12 14:54       ` Mel Gorman
     [not found] ` <1349308275-2174-2-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011105036.GN3317@csn.ul.ie>
2012-10-11 16:07     ` [PATCH 01/33] autonuma: add Documentation/vm/autonuma.txt Andrea Arcangeli
2012-10-11 19:37       ` Mel Gorman
     [not found] ` <1349308275-2174-5-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011110137.GQ3317@csn.ul.ie>
2012-10-11 16:43     ` [PATCH 04/33] autonuma: define _PAGE_NUMA Andrea Arcangeli
2012-10-11 19:48       ` Mel Gorman
     [not found] ` <1349308275-2174-6-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011111545.GR3317@csn.ul.ie>
2012-10-11 16:58     ` [PATCH 05/33] autonuma: pte_numa() and pmd_numa() Andrea Arcangeli
2012-10-11 19:54       ` Mel Gorman
     [not found] ` <1349308275-2174-7-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011122255.GS3317@csn.ul.ie>
2012-10-11 17:05     ` [PATCH 06/33] autonuma: teach gup_fast about pmd_numa Andrea Arcangeli
2012-10-11 20:01       ` Mel Gorman
     [not found] ` <1349308275-2174-8-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011122827.GT3317@csn.ul.ie>
2012-10-11 17:15     ` [PATCH 07/33] autonuma: mm_autonuma and task_autonuma data structures Andrea Arcangeli
2012-10-11 20:06       ` Mel Gorman
     [not found]     ` <5076E4B2.2040301@redhat.com>
     [not found]       ` <0000013a525a8739-2b4049fa-1cb3-4b8f-b3a7-1fa77b181590-000000@email.amazonses.com>
2012-10-12  0:52         ` Andrea Arcangeli
     [not found] ` <1349308275-2174-9-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011134643.GU3317@csn.ul.ie>
2012-10-11 17:34     ` [PATCH 08/33] autonuma: define the autonuma flags Andrea Arcangeli
2012-10-11 20:17       ` Mel Gorman
     [not found] ` <1349308275-2174-11-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011145805.GW3317@csn.ul.ie>
2012-10-12  0:25     ` [PATCH 10/33] autonuma: CPU follows memory algorithm Andrea Arcangeli
2012-10-12  8:29       ` Mel Gorman
     [not found] ` <20121011213432.GQ3317@csn.ul.ie>
2012-10-12  1:45   ` [PATCH 00/33] AutoNUMA27 Andrea Arcangeli
2012-10-12  8:46     ` Mel Gorman
     [not found] ` <1349308275-2174-16-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121011155302.GA3317@csn.ul.ie>
     [not found]     ` <50770314.7060800@redhat.com>
     [not found]       ` <20121011175953.GT1818@redhat.com>
2012-10-12 14:03         ` [PATCH 15/33] autonuma: alloc/free/init task_autonuma Rik van Riel
2012-10-13 18:40 ` [PATCH 00/33] AutoNUMA27 Srikar Dronamraju
2012-10-14  4:57   ` Andrea Arcangeli
2012-10-15  8:16     ` Srikar Dronamraju
2012-10-23 16:32     ` Srikar Dronamraju
     [not found] ` <1349308275-2174-20-git-send-email-aarcange@redhat.com>
     [not found]   ` <20121013180618.GC31442@linux.vnet.ibm.com>
2012-10-15  8:24     ` [PATCH 19/33] autonuma: memory follows CPU algorithm and task/mm_autonuma stats collection Srikar Dronamraju
2012-10-15  9:20       ` Mel Gorman
2012-10-15 10:00         ` Srikar Dronamraju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5072D8CC.6020705@hp.com \
    --to=don.morris@hp.com \
    --cc=Alex@linux.intel.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=Sh@linux.intel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=bharata.rao@gmail.com \
    --cc=cl@linux.com \
    --cc=danms@us.ibm.com \
    --cc=dhillf@gmail.com \
    --cc=drjones@redhat.com \
    --cc=efault@gmx.de \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=pjt@google.com \
    --cc=pzijlstr@redhat.com \
    --cc=riel@redhat.com \
    --cc=suresh.b.siddha@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vatsa@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox