From: Dario Faggioli <raistlin@linux.it>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Andre Przywara <andre.przywara@amd.com>,
Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Juergen Gross <juergen.gross@ts.fujitsu.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH 1 of 3 v5/leftover] libxl: enable automatic placement of guests on NUMA nodes [and 1 more messages]
Date: Thu, 19 Jul 2012 14:47:00 +0200 [thread overview]
Message-ID: <1342702020.19530.190.camel@Solace> (raw)
In-Reply-To: <1342617248.26734.32.camel@zakaz.uk.xensource.com>
[-- Attachment #1.1: Type: text/plain, Size: 3645 bytes --]
On Wed, 2012-07-18 at 14:14 +0100, Ian Campbell wrote:
> On Wed, 2012-07-18 at 12:00 +0100, Ian Jackson wrote:
> > An upper bound on log(number_of_combinations) is
> > log(number_of_nodes_on_the_host) * number_of_nodes_for_the_guest.
> > This fact could be used to determine more accurately whether the
> > algorithm is going to terminate in a reasonable time.
>
> This seems like something which could be done for 4.2.0 and is better
> than the more static limit and better than no NUMA at all. Dario can you
> do something for this soon, as in this week or not later than next?
>
Ok, I think I can do something like the below.
Remember there is an external cycle (the while{}) with
i:=[min_nodes...max_nodes] (with, typically, min_nodes=1 and
max_nodes=nr_ndoes). Nested in it, there is another cycle (the for{}),
performing exactly C(nr_nodes i) steps. So:
1) I'll killing the need for storing the full list of combinations and
I'll run the comparisons on-line, so that I always have the best
temporary placement candidate, and I can return it anytime;
2) at the beginning of each step of the for{} (the inner cycle) I
check if the overall number of steps exceeds a given threshold (I
was thinking to 2^18=262144) and if it does I just stop, no matter
whether or not I have a solution;
The --unlikely but-- worst that can happen is the algorithm runs for a
while and at some point it terminates with a suboptimal candidate or
with nothing at all.
However, please consider that placement on an 8 nodes host requires 256
steps, on 16 nodes it takes 65536 steps. Thus, bad things would only
happen on systems with nr_nodes>16, which we now know will probably
never exist! :-)
As an alternative, after thinking quite a bit about it, I found a way to
produce a reasonably good estimation of (an upper bound of) the total
number of steps (as the log(n)*p suggested above is nice, but very very
far from being precise enough, I'm afraid). So, using that to know in
advance whether or not we should run is possible, but calculating it
requires some quite advanced math that I'm not very keen on implementing
here, as it will be ugly and not so easy to understand and maintain
(although I'd do my best in providing good comments :-)). OTOH, doing
like I described above enables the possibility of finding a (maybe
suboptimal) placement in a reasonable amount of time even on those
theoretic large systems, which is something good, I think.
> > Also when this algorithm would be used, but would take too long, we
> > should print a warning which tells the user they should use cpupools
> > to assign nodes directly.
>
> Agreed.
>
This is definitely possible, although doing it _in_advance_ and being
precise enough would involve the advanced math I was talking about
before.
I can print the warning on-line, as soon as the estimated number of
steps reaches some threshold (lower that the one used to stop the
algorithm. I was thinking at 2^16=65536), would that be reasonable? I of
course can also print the warning in advance basing on the response of
some rough estimation, but I fear it would not be that useful then...
I'm implementing the thing just right now. If you have any feedback,
please shout it loud, and the sooner the better. :-D
Thanks a lot and Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2012-07-19 12:47 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-10 15:03 [PATCH 0 of 3 v4/leftover] Automatic NUMA placement for xl Dario Faggioli
2012-07-10 15:03 ` [PATCH 1 of 3 v4/leftover] libxl: enable automatic placement of guests on NUMA nodes Dario Faggioli
2012-07-17 15:55 ` Ian Jackson
2012-07-16 17:13 ` [PATCH 0 of 3 v5/leftover] Automatic NUMA placement for xl Dario Faggioli
2012-07-16 17:13 ` [PATCH 1 of 3 v5/leftover] libxl: enable automatic placement of guests on NUMA nodes Dario Faggioli
2012-07-17 18:04 ` [PATCH 1 of 3 v5/leftover] libxl: enable automatic placement of guests on NUMA nodes [and 1 more messages] Ian Jackson
2012-07-17 20:23 ` Ian Campbell
2012-07-18 0:31 ` Dario Faggioli
2012-07-18 10:44 ` Ian Jackson
2012-07-18 0:22 ` Dario Faggioli
2012-07-18 8:27 ` Dario Faggioli
2012-07-18 9:13 ` Ian Campbell
2012-07-18 9:43 ` Dario Faggioli
2012-07-18 9:53 ` Ian Campbell
2012-07-18 10:08 ` Dario Faggioli
2012-07-18 11:00 ` Ian Jackson
2012-07-18 13:14 ` Ian Campbell
2012-07-18 13:35 ` Dario Faggioli
2012-07-19 12:47 ` Dario Faggioli [this message]
2012-07-18 13:40 ` Andre Przywara
2012-07-18 13:54 ` Juergen Gross
2012-07-18 14:00 ` Dario Faggioli
2012-07-19 14:43 ` Ian Jackson
2012-07-19 18:37 ` Andre Przywara
2012-07-21 1:46 ` Dario Faggioli
2012-07-18 10:53 ` Ian Jackson
2012-07-18 13:12 ` Ian Campbell
2012-07-18 9:47 ` Dario Faggioli
2012-07-19 12:21 ` [PATCH 1 of 3 v5/leftover] libxl: enable automatic placement of guests on NUMA nodes Andre Przywara
2012-07-19 14:22 ` Dario Faggioli
2012-07-20 8:19 ` Andre Przywara
2012-07-20 9:39 ` Dario Faggioli
2012-07-20 10:01 ` Dario Faggioli
2012-07-20 8:20 ` Dario Faggioli
2012-07-20 8:26 ` Andre Przywara
2012-07-20 8:38 ` Juergen Gross
2012-07-20 9:52 ` Dario Faggioli
2012-07-20 9:56 ` Juergen Gross
2012-07-20 9:44 ` Dario Faggioli
2012-07-20 11:47 ` Andre Przywara
2012-07-20 12:54 ` Dario Faggioli
2012-07-20 13:07 ` Andre Przywara
2012-07-21 1:44 ` Dario Faggioli
2012-07-16 17:13 ` [PATCH 2 of 3 v5/leftover] libxl: have NUMA placement deal with cpupools Dario Faggioli
2012-07-16 17:13 ` [PATCH 3 of 3 v5/leftover] Some automatic NUMA placement documentation Dario Faggioli
2012-07-20 11:07 ` [PATCH 0 of 3 v5/leftover] Automatic NUMA placement for xl David Vrabel
2012-07-20 11:43 ` Andre Przywara
2012-07-20 12:00 ` Ian Campbell
2012-07-20 12:08 ` Ian Campbell
2012-07-23 10:38 ` Dario Faggioli
2012-07-23 10:42 ` Ian Campbell
2012-07-23 15:31 ` Dario Faggioli
2012-07-23 10:23 ` Dario Faggioli
2012-07-20 12:14 ` David Vrabel
2012-07-17 15:59 ` [PATCH 1 of 3 v4/leftover] libxl: enable automatic placement of guests on NUMA nodes Ian Campbell
2012-07-17 18:01 ` Ian Jackson
2012-07-17 22:15 ` Dario Faggioli
2012-07-10 15:03 ` [PATCH 2 of 3 v4/leftover] libxl: have NUMA placement deal with cpupools Dario Faggioli
2012-07-10 15:03 ` [PATCH 3 of 3 v4/leftover] Some automatic NUMA placement documentation Dario Faggioli
2012-07-16 17:03 ` [PATCH 0 of 3 v4/leftover] Automatic NUMA placement for xl Dario Faggioli
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=1342702020.19530.190.camel@Solace \
--to=raistlin@linux.it \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=andre.przywara@amd.com \
--cc=juergen.gross@ts.fujitsu.com \
--cc=xen-devel@lists.xen.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;
as well as URLs for NNTP newsgroup(s).