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

Re: [RFC PATCH v1 2/6] sched: track time spent in hypervisor tasks


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Thu, 18 Jun 2020 02:50:50 +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=b20j/K/217vYUbZ/Ef5p7dL2LuEFddj3s/AcWuYZGfc=; b=UUrYa0+cbhj1MDvjpz9GVoK4HhfWRiA9rWCM+a4k7MHSePqmmjZbhK0m6q6d2nt4dJUpTg7JxCscutWVRh16bRCfVi6Ty/Mc+yUqflXo5xiz1I5Kw/U71PbO+ckRLqW/ROUX7lqvEvbL1cI/ZWEcaCiz+7Gimw0Kpuz9v+rLJcRLQj3630+MZnXHnJUZF6qmhyPI5PJtM/mKZhF/9dxKozEZa1ZZK17Baa7t5RYJp/J4cjPUQEPI4Cc7fOA6hwee5K0Z0C8Tzy+DYW+jDnJO8dfXluk6YVtfhe7yqqAkjzjib9/VCymZVPqLKWF2yPBoXfPZbi5lz7zB/rA/QSj0Dg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OvAjnMA4z0MvsiREi0f4dsvaj0IbrFs753qzYcgJwNrLCUKIC+1FZeU1yLaMdk6yblJokfcdu5WB1G9GkdQE7L5JQjk4QI1AujpLVTFxK/jrbjw9mowF9VQiXKm6GNJnQZWUT6/x1/Ryez0BX4+ycRzkca48TfH2H/xCH4RRSudMWXxaLRDJjQlV+XYml3Gx0VZYmEXAl9jp6jEuT8+X2ietRgzISfS7KJ91EriulummEvl/Bcwx90j1jovzmdEnSFf6SV8CgfaRxDHNKOpMAprNBFtjaYdUOB2iJEvvGtk9XO4qlrZVtd8PzN8sDrVyeFswexNtBmBB5HYK2Sm/oQ==
  • Authentication-results: suse.com; dkim=none (message not signed) header.d=none;suse.com; 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>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 18 Jun 2020 02:51:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWQE+SUtF98x/3akmRxwBff1s+m6jbDBqAgAKp0oA=
  • Thread-topic: [RFC PATCH v1 2/6] sched: track time spent in hypervisor tasks

Hi Jan,

Jan Beulich writes:

> On 12.06.2020 02:22, Volodymyr Babchuk wrote:
>> In most cases hypervisor code performs guest-related jobs. Tasks like
>> hypercall handling or MMIO access emulation are done for calling vCPU
>> so it is okay to charge time spent in hypervisor to the current vCPU.
>> 
>> But, there are also tasks that are not originated from guests. This
>> includes things like TLB flushing or running tasklets. We don't want
>> to track time spent in this tasks to a total scheduling unit run
>> time. So we need to track time spent in such housekeeping tasks
>> separately.
>> 
>> Those hypervisor tasks are run in do_softirq() function, so we'll
>> install our hooks there.
>
> I can see the point and desire, but it feels like you're moving from
> one kind of unfairness to another: A softirq may very well be on
> behalf of a specific vCPU, in which case not charging current should
> lead to charging that specific one (which may still be current then).
> Even more than for TLB flushes this may be relevant for the cases
> where (on x86) we issue WBINVD on behalf of a guest.

I'm agree with you. Something similar we discussed with Dario, but in
do_IRQ() context: we can determine for which CPU we are handling
interrupt and we can charge that vcpu for the spent time. The same
stands correct for cases that you described: for some soft irqs there is
a known benefactor, so we can charge it for the spent time.

I and Dario agreed to implement this in the second stage. I'm working on
the next version of the patches and I'll look at this more
closely. There is a possibility that I'll introduce that feature. But
I'll need some help from you or some other x86 expert.

Anyways, are you okay with the general approach? We will work out the
details, but I want to be sure that I'm moving in the right direction.

-- 
Volodymyr Babchuk at EPAM


 


Rackspace

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