[PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()

Juergen Gross posted 3 patches 5 years, 9 months ago
Maintainers: Stefano Stabellini <sstabellini@kernel.org>, Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Dario Faggioli <dfaggioli@suse.com>, George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>, Ian Jackson <ian.jackson@eu.citrix.com>, Jan Beulich <jbeulich@suse.com>
[PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()
Posted by Juergen Gross 5 years, 9 months ago
With support of core scheduling sched_unit_migrate_finish() gained a
call of sync_vcpu_execstate() as it was believed to be called as a
result of vcpu migration in any case.

In case of migrating a vcpu away from a physical cpu for a short period
of time ionly without ever being scheduled on the selected new cpu this
might not be true, so drop the call and let the lazy state syncing do
its job.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V2:
- new patch
---
 xen/common/sched/core.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 5df66cbf9b..cb49a8bc02 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -1078,12 +1078,7 @@ static void sched_unit_migrate_finish(struct sched_unit *unit)
     sched_spin_unlock_double(old_lock, new_lock, flags);
 
     if ( old_cpu != new_cpu )
-    {
-        /* Vcpus are moved to other pcpus, commit their states to memory. */
-        for_each_sched_unit_vcpu ( unit, v )
-            sync_vcpu_execstate(v);
         sched_move_irqs(unit);
-    }
 
     /* Wake on new CPU. */
     for_each_sched_unit_vcpu ( unit, v )
-- 
2.26.1


Re: [PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()
Posted by Dario Faggioli 5 years, 8 months ago
On Thu, 2020-05-14 at 17:36 +0200, Juergen Gross wrote:
> With support of core scheduling sched_unit_migrate_finish() gained a
> call of sync_vcpu_execstate() as it was believed to be called as a
> result of vcpu migration in any case.
> 
> In case of migrating a vcpu away from a physical cpu for a short
> period
> of time ionly without ever being scheduled on the selected new cpu 
          ^
with this typo taken care of (I guess, upon commit)...

> this
> might not be true, so drop the call and let the lazy state syncing do
> its job.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

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)

Re: [PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()
Posted by Jan Beulich 5 years, 8 months ago
On 25.05.2020 09:18, Dario Faggioli wrote:
> On Thu, 2020-05-14 at 17:36 +0200, Juergen Gross wrote:
>> With support of core scheduling sched_unit_migrate_finish() gained a
>> call of sync_vcpu_execstate() as it was believed to be called as a
>> result of vcpu migration in any case.
>>
>> In case of migrating a vcpu away from a physical cpu for a short
>> period
>> of time ionly without ever being scheduled on the selected new cpu 
>           ^
> with this typo taken care of (I guess, upon commit)...
> 
>> this
>> might not be true, so drop the call and let the lazy state syncing do
>> its job.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>
> Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

Hmm, I'm puzzled: This had gone in a week and a half ago with your
R-b sent on the 15th.

Jan

Re: [PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()
Posted by Dario Faggioli 5 years, 8 months ago
On Mon, 2020-05-25 at 15:12 +0200, Jan Beulich wrote:
> On 25.05.2020 09:18, Dario Faggioli wrote:
> > 
> > > Signed-off-by: Juergen Gross <jgross@suse.com>
> > > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> > > 
> > Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
> 
> Hmm, I'm puzzled: This had gone in a week and a half ago with your
> R-b sent on the 15th.
>
Well, at least I'm consistent! :-P

Being a bit more serious, yes I see this now. Unfortunately, it somehow
was stuck in the "wrong" folder in my MUA, making me think it was still
pending.

And of course I could have double checked either the tree or my sent
folder, but I didn't... Sorry for the noise. :-(

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)

Re: [PATCH v3 2/3] xen/sched: don't call sync_vcpu_execstate() in sched_unit_migrate_finish()
Posted by Dario Faggioli 5 years, 8 months ago
On Thu, 2020-05-14 at 17:36 +0200, Juergen Gross wrote:
> With support of core scheduling sched_unit_migrate_finish() gained a
> call of sync_vcpu_execstate() as it was believed to be called as a
> result of vcpu migration in any case.
> 
> In case of migrating a vcpu away from a physical cpu for a short
> period
> of time ionly without ever being scheduled on the selected new cpu
> this
> might not be true, so drop the call and let the lazy state syncing do
> its job.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

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)