From: Mel Gorman <mel@csn.ul.ie>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Peter Zijlstra <pzijlstr@redhat.com>, Ingo Molnar <mingo@elte.hu>,
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>
Subject: Re: [PATCH 07/33] autonuma: mm_autonuma and task_autonuma data structures
Date: Thu, 11 Oct 2012 21:06:08 +0100 [thread overview]
Message-ID: <20121011200608.GO3317@csn.ul.ie> (raw)
In-Reply-To: <20121011171519.GQ1818@redhat.com>
On Thu, Oct 11, 2012 at 07:15:20PM +0200, Andrea Arcangeli wrote:
> On Thu, Oct 11, 2012 at 01:28:27PM +0100, Mel Gorman wrote:
> > s/togehter/together/
>
> Fixed.
>
> >
> > > + * knumad_scan structure.
> > > + */
> > > +struct mm_autonuma {
> >
> > Nit but this is very similar in principle to mm_slot for transparent
> > huge pages. It might be worth renaming both to mm_thp_slot and
> > mm_autonuma_slot to set the expectation they are very similar in nature.
> > Could potentially be made generic but probably overkill.
>
> Agreed. A plain rename to mm_autonuma_slot would have the only cons of
> making some code spill over 80 col ;).
>
Fair enough :)
> > > + /* link for knuma_scand's list of mm structures to scan */
> > > + struct list_head mm_node;
> > > + /* Pointer to associated mm structure */
> > > + struct mm_struct *mm;
> > > +
> > > + /*
> > > + * Zeroed from here during allocation, check
> > > + * mm_autonuma_reset() if you alter the below.
> > > + */
> > > +
> > > + /*
> > > + * Pass counter for this mm. This exist only to be able to
> > > + * tell when it's time to apply the exponential backoff on the
> > > + * task_autonuma statistics.
> > > + */
> > > + unsigned long mm_numa_fault_pass;
> > > + /* Total number of pages that will trigger NUMA faults for this mm */
> > > + unsigned long mm_numa_fault_tot;
> > > + /* Number of pages that will trigger NUMA faults for each [nid] */
> > > + unsigned long mm_numa_fault[0];
> > > + /* do not add more variables here, the above array size is dynamic */
> > > +};
> >
> > How cache hot is this structure? nodes are sharing counters in the same
> > cache lines so if updates are frequent this will bounce like a mad yoke.
> > Profiles will tell for sure but it's possible that some sort of per-cpu
> > hilarity will be necessary here in the future.
>
> On autonuma27 this is only written by knuma_scand so it won't risk to
> bounce.
>
> On autonuma28 however it's updated by the numa hinting page fault
> locklessy and so your concern is very real, and the cacheline bounces
> will materialize.
It will be related to the knuma_scan thing though so once every 10
seconds, we might see a sudden spike in cache conflicts. Is that
accurate? Something like perf top might detect when this happens but it
can be inferred using perf probe on the fault handler too.
> It'll cause more interconnect traffic before the
> workload converges too. I thought about that, but I wanted the
> mm_autonuma updated in real time as migration happens otherwise it
> converges more slowly if we have to wait until the next pass to bring
> mm_autonuma statistical data in sync with the migration
> activities. Converging more slowly looked worse than paying more
> cacheline bounces.
>
You could argue that slower converging also means more cross-node
traffic so it costs either way.
> It's a tradeoff. And if it's not a good one, we can go back to
> autonuma27 mm_autonuma stat gathering method and converge slower but
> without any cacheline bouncing in the NUMA hinting page faults. At
> least it's lockless.
>
Yep.
> > > + unsigned long task_numa_fault_pass;
> > > + /* Total number of eligible pages that triggered NUMA faults */
> > > + unsigned long task_numa_fault_tot;
> > > + /* Number of pages that triggered NUMA faults for each [nid] */
> > > + unsigned long task_numa_fault[0];
> > > + /* do not add more variables here, the above array size is dynamic */
> > > +};
> > > +
> >
> > Same question about cache hotness.
>
> Here it's per-thread, so there won't be risk of accesses interleaved
> by different CPUs.
>
Ok thanks. With that clarification
Acked-by: Mel Gorman <mgorman@suse.de>
While I still have concerns about the cache behaviour of this the basic
intent of the structure will not change no matter how the problem is
addressed.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2012-10-11 20:06 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
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 [this message]
[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=20121011200608.GO3317@csn.ul.ie \
--to=mel@csn.ul.ie \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--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=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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=torvalds@linux-foundation.org \
/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
Powered by JetHome