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

Re: [Xen-devel] [RFC 1/6] xen/arm: Re-enable interrupt later in the trap path


  • To: "andrii.anisov@xxxxxxxxx" <andrii.anisov@xxxxxxxxx>, "julien.grall@xxxxxxx" <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dario Faggioli <dfaggioli@xxxxxxxx>
  • Date: Sat, 3 Aug 2019 01:39:47 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.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=T+wjiXSvqKzoQzl5RyOzXHi4kQEQCuV8t/yF+TDnXZI=; b=eo2Fu+NjA/mmEQd82dAG3AFLO3i6ynE2Ocq9ccBOjO7aUI6233dwwaAHbtRqtshtl/8Wkqg56vFK/F1Hp7vOPSMjiEUAc6IzcC1IJ58qhK1h4uAYqppVkdl2MvjCWSCnqjwooi89euR0lWpDm8PPFkpm34e6eDOFD/w0y9ZlP/3RyjXcD2v/1dlumBljgeIVPNEs1dwzjb+d7M32EnT1cudBYHEgF26CPyObscovqtoTkvCh1ZGFiM9ApTrNP6jnX9JT02pxH+wdZhYxlkyp4yj8qMkNSSaDt51wKFeruC4tZfZMurpGp14374OZ+eVTU8Xo6a76wtmMplhnDedZ/g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kqZjB8udEphqzd7By9X6fTsKcpxDwt2MKbsB1KjChB9K5n9y3cQ8Wh5QuyE+UX/ZA1YwsJYCc18CrtzdfUQG/BrJetxWXreec8aUI12wTdUfUYrSnVekL/SaUl6D+y0RfJEKqawoaMts/sR7ZuxbW/4WGs+B8Y1rjXf9GHJR75POfAGgdakHcJ44u+kwRA8nrZ7Idrr5jdNFcecuNU03N2BYEkzsZZGOZDOZ/af7Nwv5jrgtf8oybEdfq0uF/QrmocVqRca4TNGCMQ5bmS55WL7IS2+j+ZLO8OwFus572/yuicai0/C+6ljzS5nFCLA0o3D3xTwhsJxMLy5fwSluWA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=dfaggioli@xxxxxxxx;
  • Cc: "andrii_anisov@xxxxxxxx" <andrii_anisov@xxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "Volodymyr_Babchuk@xxxxxxxx" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Sat, 03 Aug 2019 01:40:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVSQcBz01X1+GS1EGqbA6JcY+nvabnk6IDgABBB2OAAAvedYAAxhKA
  • Thread-topic: [Xen-devel] [RFC 1/6] xen/arm: Re-enable interrupt later in the trap path

On Fri, 2019-08-02 at 14:49 +0100, Julien Grall wrote:
> /!\/!\/!\
> 
> I am not a scheduler expert so my view maybe be wrong. Dario feel
> free to 
> correct me :).
> 
> /!\/!\/!\
> 
:-)

> On 02/08/2019 14:07, Andrii Anisov wrote:
> > On 02.08.19 12:15, Julien Grall wrote:
> > > > 
> > But the time spent by hypervisor to handle interrupts, update the
> > hardware state 
> > is not requested by the guest itself. It is a virtualization
> > overhead. And the 
> > overhead heavily depends on the system configuration (e.g. how many
> > guests are 
> > running).
> 
> While context switch cost will depend on your system configuration.
> The HW state 
> synchronization on entry to the hypervisor and exit from the
> hypervisor will 
> always be there. This is even if you have one guest running or
> partitioning your 
> system.
> 
This might be a good way of thinking to this problem. The
overhead/hypervisor time that is always there, even if you are running
only one guest, with static and strict resource partitioning (e.g.,
hypercalls, IRQs), you want it charged to the guest.

The overhead/hypervisor time coming from operations that you do because
you have multiple guests and/or non-static partitioning (e.g.,
scheduling, load balancing), you don't want it charged to any specific
guest.

Note that, we're talking, in both cases of "hypervisor time".

> There are some issues to account some of the work on exit to the
> hypervisor 
> time. Let's take the example of the P2M, this task is a deferred work
> from an 
> system register emulation because we need preemption.
> 
> The task can be long running (several hundred milliseconds). A
> scheduler may 
> only take into account the guest time and consider that vCPU does not
> need to be 
> unscheduled. You are at the risk a vCPU will hog a pCPU and delay any
> other 
> vCPU. This is not something ideal even for RT task.
> 
Yes, this is indeed an example of what I was also describing in my
other email.

> Other work done on exit (e.g syncing the vGIC state to HW) will be
> less a 
> concern where they are accounted because it cannot possibly hog a
> pCPU.
> 
Indeed. But it'd still be good to charge the proper entity for it, if
possible. :-)

> I understand you want to get the virtualization overhead. It feels to
> me, this 
> needs to be a different category (i.e neither hypervisor time, nor
> guest time).
> 
IMO, what we need to do is separate the concept of guest/hypervisor
time, from the fact that we account/charge someone or not (and if yes,
who).

E.g., hypercalls are hypervisor time and (in most cases) you want to
charge a guest making the hypercalls for it. OTOH, running QEMU (e.g.,
in dom0) is guest time, and you want to charge the guest for which QEMU
is acting as a DM for it (not dom0).

Of course, some parts of this (e.g., the QEMU running in dom0 one) are
going to be very difficult, if possible at all, to implement. But
still, this would be the idea, IMO.

> > Our target is XEN in safety critical systems. So I chosen more
> > deterministic 
> > (from my point of view) approach.
> 
> See above, I believe you are building an secure system with
> accounting some of 
> the guest work to the hypervisor.
> 
Yep, I do agree with Julien here. Doing the accounting right, you get
both a more robust and a more fair system.

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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