xen: credit2: make runqueues be per-socket by default.
PATCH 1/1 xen: credit2: make runqueues be per-socket by default.
Hi,
This patch changes the way in which runqueue are arranged by default in Credit2. Despite being so late, I think this should go in Xen 4.8, and here's why.
So, first of all, runqueues in Credit2 can be arranged in various ways, just by means of a Xen boot parameter. Right now, the default is one runqueue per-core. I think we should switch that to one runqueue per-socket.
In fact, all the testing and the benchmarking that I have done before sending all the various patch series about Credit2 within this release cycle, happened with per-socket runqueues.
The numbers reported here, for instance, show how per-socket is better:
https://lists.xen.org/archives/html/xen-devel/2016-06/msg02287.html
Pretty much all the other results we have tell the same.
Most of Anshul's benchmarks, the ones he presented at XenSummit, the ones he has run after that, and the ones he is running now, use per-socket runqueues.
The reason why we did go for per-core in 4.7, was to introduce some form of hyperthreading support. Now, we have hyperthreading support, independently from how runqueues are organized (9bb9c7388 "xen: credit2: implement true SMT support").
So, in summary, the per-socket ruqneueue configuration is _BOTH_ more tested, and provide better performance.
The reason why I'm proposing this only now is basically because I thought I had sent a patch for that already, but I've recently discovered that I must have took such patch off from one of the series at the last minute. And since then, I've always forgot to double check... :-(
As it is easy to check, the change is entirely self contained within Credit2, and bears no risks.
Finally, note that, given the timing (and the fact that he is away), I spoke with George out of band, and he told me I can put his Ack on the patch. Of course, we defer to Wei to decide if this is still acceptable.
Thanks, and sorry, and Regards, :-)
Dario
---
Dario Faggioli (1):
xen: credit2: make runqueues be per-socket by default.
docs/misc/xen-command-line.markdown | 2 +- xen/common/sched_credit2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/1 xen: credit2: make runqueues be per-socket by default.
Benchmarks have shown that per-socket runqueues arrangement behaves better (e.g., we achieve better load balancing) than the current per-core default.
Here's an example (coming from
https://lists.xen.org/archives/html/xen-devel/2016-06/msg02287.html ):
|=======================================| | XEN BUILD TIME, LOW LOAD, NO NOISE | |---------------------------------------| | runq=core runq=socket | | 35.200 33.433 | |---------------------------------------|------------------------------| | XEN BUILD TIME, HIGH LOAD, NO NOISE | IPERF, HIGH LOAD, NO NOISE | |---------------------------------------|------------------------------| | runq=core runq=socket | runq=core runq=socket | | 18.013 18.530 | 23.200 23.466 | |---------------------------------------|------------------------------| | XEN BUILD TIME, LOW LOAD, WITH NOISE | |------------------------------------- | | runq=core runq=socket | | 45.866 39.493 | |---------------------------------------|------------------------------| | XEN BUILD TIME, HIGH LOAD, WITH NOISE | IPERF, HIGH LOAD, WITH NOISE | |---------------------------------------|------------------------------| | runq=core runq=socket | runq=core runq=socket | | 36.840 29.080 | 19.967 21.000 | |=======================================|==============================|
The only reason why we went for per-core, initially, was to introduce some form of hyperthreading support. Now we have hyperthreading support, independently from how runqueues are organized (9bb9c7388 "xen: credit2: implement true SMT support"), and thus we can switch to per-socket.
---
Cc: Anshul Makkar <[email protected]>
Cc: Wei Liu <[email protected]>
---
George's Ack obtained 'out of band', as he is away.
--- docs/misc/xen-command-line.markdown | 2 +- xen/common/sched_credit2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
docs/misc/xen-command-line.markdown +1 -1
@@ -527,7 +527,7 @@ The default value of `1 sec` is rather long. ### credit2\_runqueue > `= core | socket | node | all` -> Default: `core` +> Default: `socket` Specify how host CPUs are arranged in runqueues. Runqueues are kept balanced with respect to the load generated by the vCPUs running on
xen/common/sched_credit2.c +1 -1
@@ -330,7 +330,7 @@ static const char *const opt_runqueue_str[] = { [OPT_RUNQUEUE_NODE] = "node", [OPT_RUNQUEUE_ALL] = "all" }; -static int __read_mostly opt_runqueue =OPT_RUNQUEUE_CORE ; +static int __read_mostly opt_runqueue =OPT_RUNQUEUE_SOCKET ;static void parse_credit2_runqueue (const char *s) {
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 35 lines · Dario Faggioli
Benchmarks have shown that per-socket runqueues arrangement behaves better (e.g., we achieve better load balancing) than the current per-core default.
Here's an example (coming from
https://lists.xen.org/archives/html/xen-devel/2016-06/msg02287.html ):|=======================================| | XEN BUILD TIME, LOW LOAD, NO NOISE | |---------------------------------------| | runq=core runq=socket | | 35.200 33.433 | |---------------------------------------|------------------------------| | XEN BUILD TIME, HIGH LOAD, NO NOISE | IPERF, HIGH LOAD, NO NOISE | |---------------------------------------|------------------------------| | runq=core runq=socket | runq=core runq=socket | | 18.013 18.530 | 23.200 23.466 | |---------------------------------------|------------------------------| | XEN BUILD TIME, LOW LOAD, WITH NOISE | |------------------------------------- | | runq=core runq=socket | | 45.866 39.493 | |---------------------------------------|------------------------------| | XEN BUILD TIME, HIGH LOAD, WITH NOISE | IPERF, HIGH LOAD, WITH NOISE | |---------------------------------------|------------------------------| | runq=core runq=socket | runq=core runq=socket | | 36.840 29.080 | 19.967 21.000 | |=======================================|==============================|The only reason why we went for per-core, initially, was to introduce some form of hyperthreading support. Now we have hyperthreading support, independently from how runqueues are organized (
9bb9c7388"xen: credit2: implement true SMT support"), and thus we can switch to per-socket.
Quoted 8 lines
Signed-off-by Dario Faggioli <[email protected]>Acked-by George Dunlap <[email protected]>---
Cc: Anshul Makkar <[email protected]>
Cc: Wei Liu <[email protected]>
---
George's Ack obtained 'out of band', as he is away.
---
Strictly speaking, this is not necessary for 4.8 because even though the default configuration is not optimal, there is a simple way to change it.
On the other hand, because credit2 is declared supported in this release, it is better to have a sensible default setting for credit2.
The risk is that changing the default value would cause osstest to discover bugs in the scheduler logic, hence blocking the release. But overall I think the chance is low, but Dario can you please state to what extend did you test this patch?
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines · Wei Liu
On Tue, Nov 29, 2016 at 11:57:03AM +0100, Dario Faggioli wrote:
Strictly speaking, this is not necessary for 4.8 because even though the
default configuration is not optimal, there is a simple way to change it.
Absolutely true.
Quoted 3 lines
On the other hand, because credit2 is declared supported in this release, it is better to have a sensible default setting for credit2.
Exactly.
Quoted 5 lines
The risk is that changing the default value would cause osstest to discover bugs in the scheduler logic, hence blocking the release. But overall I think the chance is low, but Dario can you please state to what extend did you test this patch?
I've tried to state that in the cover letter:
https://lists.xen.org/archives/html/xen-devel/2016-11/msg02616.html
In some more details, it is _months_ that I and Anshul run benchmarks with Credit2 running in this configuration.
It's months that, all the time that I boot my test box, either to do Credit2 related development and testing, or completely unrelated things (e.g., recently, when testing the new Fedora 25 as HVM and PV guest), I use Credit2 in this configuration.
George has done some runs of his schedbench suite with this configuration (to compare Credit1 vs Credit2 per-core vs Credit2 per- socket).
So, if you ask me "how much is this tested", my answer would be "really really really a lot". :-)
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 14 lines · Dario Faggioli
Quoted 6 lines · Wei Liu
On Tue, Nov 29, 2016 at 11:57:03AM +0100, Dario Faggioli wrote:
Strictly speaking, this is not necessary for 4.8 because even though the
default configuration is not optimal, there is a simple way to change it.Absolutely true.
Quoted 3 lines
On the other hand, because credit2 is declared supported in this release, it is better to have a sensible default setting for credit2.
Exactly.
Quoted 8 lines
Quoted 5 lines
The risk is that changing the default value would cause osstest to discover bugs in the scheduler logic, hence blocking the release. But overall I think the chance is low, but Dario can you please state to what extend did you test this patch?
I've tried to state that in the cover letter:
https://lists.xen.org/archives/html/xen-devel/2016-11/msg02616.html
Ah, I thought that was a dupe because it had the same subject line as the patch, so I skipped it.
Quoted 8 lines
In some more details, it is _months_ that I and Anshul run benchmarks with Credit2 running in this configuration.
It's months that, all the time that I boot my test box, either to do Credit2 related development and testing, or completely unrelated things (e.g., recently, when testing the new Fedora 25 as HVM and PV guest), I use Credit2 in this configuration.
Quoted 7 lines
George has done some runs of his schedbench suite with this configuration (to compare Credit1 vs Credit2 per-core vs Credit2 per- socket).
So, if you ask me "how much is this tested", my answer would be "really really really a lot". :-)
OK. This is rather convincing to me. I will wait a bit for other people express their opinion.
Wei.
Quoted 6 lines
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 29.11.16 at 12:42, <[email protected]> wrote:
Quoted 19 lines · Dario Faggioli
Quoted 6 lines · Wei Liu
On Tue, Nov 29, 2016 at 11:57:03AM +0100, Dario Faggioli wrote:
Strictly speaking, this is not necessary for 4.8 because even though the
default configuration is not optimal, there is a simple way to change it.Absolutely true.
Quoted 3 lines
On the other hand, because credit2 is declared supported in this release, it is better to have a sensible default setting for credit2.
Exactly.
Quoted 5 lines
The risk is that changing the default value would cause osstest to discover bugs in the scheduler logic, hence blocking the release. But overall I think the chance is low, but Dario can you please state to what extend did you test this patch?
Quoted 6 lines
Quoted 3 lines
I've tried to state that in the cover letter:
https://lists.xen.org/archives/html/xen-devel/2016-11/msg02616.htmlAh, I thought that was a dupe because it had the same subject line as the patch, so I skipped it.
Same here, albeit I had noticed I shouldn't have got 2 copies, so I did look into the other one.
Quoted 12 lines
Quoted 12 lines
In some more details, it is _months_ that I and Anshul run benchmarks with Credit2 running in this configuration.
It's months that, all the time that I boot my test box, either to do Credit2 related development and testing, or completely unrelated things (e.g., recently, when testing the new Fedora 25 as HVM and PV guest), I use Credit2 in this configuration.
George has done some runs of his schedbench suite with this configuration (to compare Credit1 vs Credit2 per-core vs Credit2 per- socket).
Quoted 6 lines
Quoted 3 lines
So, if you ask me "how much is this tested", my answer would be "really really really a lot". :-)
OK. This is rather convincing to me. I will wait a bit for other people express their opinion.
FWIW, I'm in favor of putting it in with the background provided.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 5 lines
Quoted 1 line · On 29.11.16 at 12:42, <[email protected]> wrote:
I've tried to state that in the cover letter:
https://lists.xen.org/archives/html/xen-devel/2016-11/msg02616.ht
ml
Quoted 7 lines
Quoted 3 lines
Ah, I thought that was a dupe because it had the same subject line as
the patch, so I skipped it.Same here, albeit I had noticed I shouldn't have got 2 copies, so I did look into the other one.
Ah, I see it can indeed look confusing. I hadn't thought about that, sorry.
Quoted 6 lines
Quoted 3 lines
OK. This is rather convincing to me. I will wait a bit for other people
express their opinion.FWIW, I'm in favor of putting it in with the background provided.
Whatever the outcome, thanks for having a look (well, to Jan, Wei was kind of forced to do so! :-P :-P)
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 43 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 29.11.16 at 12:42, <[email protected]> wrote:
Quoted 19 lines · Dario Faggioli
Quoted 6 lines · Wei Liu
On Tue, Nov 29, 2016 at 11:57:03AM +0100, Dario Faggioli wrote:
Strictly speaking, this is not necessary for 4.8 because even though the
default configuration is not optimal, there is a simple way to change it.Absolutely true.
Quoted 3 lines
On the other hand, because credit2 is declared supported in this release, it is better to have a sensible default setting for credit2.
Exactly.
Quoted 5 lines
The risk is that changing the default value would cause osstest to discover bugs in the scheduler logic, hence blocking the release. But overall I think the chance is low, but Dario can you please state to what extend did you test this patch?
Quoted 6 lines
Quoted 3 lines
I've tried to state that in the cover letter:
https://lists.xen.org/archives/html/xen-devel/2016-11/msg02616.htmlAh, I thought that was a dupe because it had the same subject line as the patch, so I skipped it.
Same here, albeit I had noticed I shouldn't have got 2 copies, so I did look into the other one.
Quoted 12 lines
Quoted 12 lines
In some more details, it is _months_ that I and Anshul run benchmarks with Credit2 running in this configuration.
It's months that, all the time that I boot my test box, either to do Credit2 related development and testing, or completely unrelated things (e.g., recently, when testing the new Fedora 25 as HVM and PV guest), I use Credit2 in this configuration.
George has done some runs of his schedbench suite with this configuration (to compare Credit1 vs Credit2 per-core vs Credit2 per- socket).
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
So, if you ask me "how much is this tested", my answer would be "really really really a lot". :-)
OK. This is rather convincing to me. I will wait a bit for other people express their opinion.
FWIW, I'm in favor of putting it in with the background provided.
Feel free to commit it with your other patches.
Quoted 2 lines
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel