[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH v1 0/6] Fair scheduling


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Fri, 12 Jun 2020 00:22:35 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mrWui09u+5cIgvpHZOOFv3CDq05Q0coOiwBD2KZRCAg=; b=N3iAARi5JebKkoJfrDmi2uNgsj1IrRE1dmZOmekiqPb+z1ZEyqbwlCOBrPzHRN/Ti91SXUwHq+EFID9S/ziO3HwxooJq1HtGnFTAHyVwDr+HZJZ/jLEogKQ19qV4CTJyHbpWXImTP9jGgyPsSAa2o0Pt/zuw57Jw05cpH0chIMMSo/oKgERlmUD2TpBV+CeX3BA+kYvO2+wImqC/nS/zDfQPJFnJTuvmqrEsLE0ZvPEEofCM+ITQLpiir6SpoRn7F8z63vx4/qqeBaLCiBFHx4zuFbmf4Qaj5XfwrUec+c26Nl4kJg2IwMbFhWHQeQEIR+4zDFrk+nRDFfchGqJRyw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P2oScPt5XwaGY8m7MiYF+9LVJjQiFNMBR0Zy3DwC7SRdQD2t31fbrjjp5kevnCONTZnzA7laXtUHJtqSE1OrlOOG7J8oODaCrA0y1wV/d2g74R6NV2H7ie2NuSfPiwmySo92HOxvq1pMPuoUv36OJn9hZeKkFZIt6qbXuk21RJyH4ez8q2y0ehaxIszumz20Vw1GiyCSY9cOvzSfCP+tfgeqJ15hqcqM0pvwHBo1qx8C8qWoFEshVCMLLaqpX33d74O7jDa82KvCj5BnfcN6DQ+2kD/Eljza52HBKIt3kR5K29ahjnUJIgVN+j6Zj/6nWgB3Xz2TLmzsv2vL151IQA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 12 Jun 2020 00:23:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWQE+S5leDZ35sk0y6s2xYl7vsow==
  • Thread-topic: [RFC PATCH v1 0/6] Fair scheduling

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.