xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v1 0/6] Fair scheduling
@ 2020-06-12  0:22 Volodymyr Babchuk
  2020-06-12  0:22 ` [RFC PATCH v1 2/6] sched: track time spent in hypervisor tasks Volodymyr Babchuk
                   ` (5 more replies)
  0 siblings, 6 replies; 43+ messages in thread
From: Volodymyr Babchuk @ 2020-06-12  0:22 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Julien Grall, Wei Liu, Andrew Cooper,
	Ian Jackson, George Dunlap, Dario Faggioli, Jan Beulich,
	Volodymyr Babchuk, Roger Pau Monné

There was number of discussions about fair scheduling, including latest
one at [1].

In a nutshell, schedulers don't know when pCPU is doing guest-related
work or when it is busy with something else, like running
tasklets. All time spent between two calls to schedule() is being
charged to active vCPU, which can be unfair in some cases.

Andrii Anisov tried to overcome this by counting time spent in
different "modes". But his approach was "entry.S-centric". He tried to
guess correct trap reason as early as possible. This was arm-specific
and quite intrusive. On other hand, it theoretically provided more
precise results.

As a result of that discussion with Dario at [1], we came to
conclusion that for in the first approximation we should not charge
guests for time spent in do_IRQ() and in do_softirq().

This patch series does exactly this. It separately collects time for
IRQ handling and for internal hypervisor tasks. Actually, this
separation is not needed for making scheduling decisions, but it can
prove more information to system administrators.

This is minimal implementation, so it supports only x86 and credit2
scheduler. I chose x86 over ARM because more people can try this
patches. This series provide tracing and xentop support as well, to
ease up experimenting.

I'm open to all suggestions, especially for naming things :)

Those patches also can be pulled from my GH account at [2]

[1] https://lists.xenproject.org/archives/html/xen-devel/2020-06/msg00092.html
[2] https://github.com/lorc/xen/tree/fair_sched_rfc_v1

Volodymyr Babchuk (6):
  sched: track time spent in IRQ handler
  sched: track time spent in hypervisor tasks
  sched, credit2: improve scheduler fairness
  xentop: collect IRQ and HYP time statistics.
  tools: xentop: show time spent in IRQ and HYP states.
  trace: add fair scheduling trace events

 tools/xenstat/libxenstat/src/xenstat.c      |  12 +++
 tools/xenstat/libxenstat/src/xenstat.h      |   6 ++
 tools/xenstat/libxenstat/src/xenstat_priv.h |   2 +
 tools/xenstat/xentop/xentop.c               |  54 ++++++++--
 tools/xentrace/xenalyze.c                   |  37 +++++++
 xen/arch/arm/irq.c                          |   2 +
 xen/arch/x86/irq.c                          |   2 +
 xen/common/sched/core.c                     | 110 ++++++++++++++++++++
 xen/common/sched/credit2.c                  |   2 +-
 xen/common/sched/private.h                  |  10 ++
 xen/common/softirq.c                        |   2 +
 xen/common/sysctl.c                         |   1 +
 xen/include/public/sysctl.h                 |   4 +-
 xen/include/public/trace.h                  |   5 +
 xen/include/xen/sched.h                     |  29 ++++++
 15 files changed, 265 insertions(+), 13 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2020-09-25 21:42 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12  0:22 [RFC PATCH v1 0/6] Fair scheduling Volodymyr Babchuk
2020-06-12  0:22 ` [RFC PATCH v1 2/6] sched: track time spent in hypervisor tasks Volodymyr Babchuk
2020-06-12  4:43   ` Jürgen Groß
2020-06-12 11:30     ` Volodymyr Babchuk
2020-06-12 11:40       ` Jürgen Groß
2020-09-24 18:08         ` Volodymyr Babchuk
2020-09-25 17:22           ` Dario Faggioli
2020-09-25 20:21             ` Volodymyr Babchuk
2020-09-25 21:42               ` Dario Faggioli
2020-06-16 10:10   ` Jan Beulich
2020-06-18  2:50     ` Volodymyr Babchuk
2020-06-18  6:34       ` Jan Beulich
2020-06-12  0:22 ` [RFC PATCH v1 1/6] sched: track time spent in IRQ handler Volodymyr Babchuk
2020-06-12  4:36   ` Jürgen Groß
2020-06-12 11:26     ` Volodymyr Babchuk
2020-06-12 11:29       ` Julien Grall
2020-06-12 11:33         ` Volodymyr Babchuk
2020-06-12 12:21           ` Julien Grall
2020-06-12 20:08             ` Dario Faggioli
2020-06-12 22:25               ` Volodymyr Babchuk
2020-06-12 22:54               ` Julien Grall
2020-06-16 10:06   ` Jan Beulich
2020-06-12  0:22 ` [RFC PATCH v1 3/6] sched, credit2: improve scheduler fairness Volodymyr Babchuk
2020-06-12  4:51   ` Jürgen Groß
2020-06-12 11:38     ` Volodymyr Babchuk
2020-06-12  0:22 ` [RFC PATCH v1 5/6] tools: xentop: show time spent in IRQ and HYP states Volodymyr Babchuk
2020-06-12  0:22 ` [RFC PATCH v1 6/6] trace: add fair scheduling trace events Volodymyr Babchuk
2020-06-12  0:22 ` [RFC PATCH v1 4/6] xentop: collect IRQ and HYP time statistics Volodymyr Babchuk
2020-06-12  4:57   ` Jürgen Groß
2020-06-12 11:44     ` Volodymyr Babchuk
2020-06-12 12:45       ` Julien Grall
2020-06-12 22:16         ` Volodymyr Babchuk
2020-06-18 20:24         ` Volodymyr Babchuk
2020-06-18 20:34           ` Julien Grall
2020-06-18 23:35             ` Volodymyr Babchuk
2020-06-12 12:29     ` Julien Grall
2020-06-12 12:41       ` Jürgen Groß
2020-06-12 15:29         ` Dario Faggioli
2020-06-12 22:27           ` Volodymyr Babchuk
2020-06-13  6:22             ` Jürgen Groß
2020-06-18  2:58               ` Volodymyr Babchuk
2020-06-18 15:17                 ` Julien Grall
2020-06-18 15:23                   ` Jan Beulich

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).