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

2020-09-25 Thread Dario Faggioli
On Fri, 2020-09-25 at 20:21 +, Volodymyr Babchuk wrote: > Hi Dario, > Hi! :-) > Dario Faggioli writes: > > And what about the cases where schedule() does return? > > Can it return on x86? I want to test this case, but how force it? > Null > scheduler, perhaps? > > > Are these also fine beca

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

2020-09-25 Thread Volodymyr Babchuk
Hi Dario, Dario Faggioli writes: > On Thu, 2020-09-24 at 18:08 +, Volodymyr Babchuk wrote: >> So, as I see this, functions are called in the following way (on >> x86): >> >> 1. do_softirq() calls vcpu_begin_hyp_task() and then executes >> __do_softirq() >> >> 2. __do_softirq() does diffe

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

2020-09-25 Thread Dario Faggioli
On Thu, 2020-09-24 at 18:08 +, Volodymyr Babchuk wrote: > So, as I see this, functions are called in the following way (on > x86): > > 1. do_softirq() calls vcpu_begin_hyp_task() and then executes > __do_softirq() > > 2. __do_softirq() does different jobs and eventually calls schedule() > >

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

2020-09-24 Thread Volodymyr Babchuk
Hello Jürgen, Jürgen Groß writes: > On 12.06.20 13:30, Volodymyr Babchuk wrote: >> On Fri, 2020-06-12 at 06:43 +0200, Jürgen Groß wrote: >>> On 12.06.20 02:22, Volodymyr Babchuk wrote: [...] +delta = NOW() - v->hyp_entry_time; +atomic_add(delta, &v->sched_unit->hyp_time);

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

2020-06-17 Thread Jan Beulich
On 18.06.2020 04:50, Volodymyr Babchuk wrote: > 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. I'm certainly okay with the goal; I didn't look closely enough to say I'm okay with the approach - I trust

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

2020-06-17 Thread Volodymyr Babchuk
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.

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

2020-06-16 Thread Jan Beulich
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 a

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

2020-06-12 Thread Jürgen Groß
On 12.06.20 13:30, Volodymyr Babchuk wrote: On Fri, 2020-06-12 at 06:43 +0200, Jürgen Groß wrote: On 12.06.20 02:22, Volodymyr Babchuk wrote: +void vcpu_end_hyp_task(struct vcpu *v) +{ +int delta; + +if ( is_idle_vcpu(v) ) +return; + +ASSERT(v->in_hyp_task); + +/* We ass

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

2020-06-12 Thread Volodymyr Babchuk
On Fri, 2020-06-12 at 06:43 +0200, Jürgen Groß wrote: > On 12.06.20 02:22, Volodymyr Babchuk wrote: > > +void vcpu_end_hyp_task(struct vcpu *v) > > +{ > > +int delta; > > + > > +if ( is_idle_vcpu(v) ) > > +return; > > + > > +ASSERT(v->in_hyp_task); > > + > > +/* We assume th

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

2020-06-11 Thread Jürgen Groß
On 12.06.20 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 ori