[PATCH 01/12] xen/cpupool: add cpu to sched_res_mask when removing it from cpupool

Juergen Gross posted 12 patches 5 years, 3 months ago
Maintainers: Jan Beulich <jbeulich@suse.com>, Ian Jackson <iwj@xenproject.org>, Dario Faggioli <dfaggioli@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap <george.dunlap@citrix.com>, Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
There is a newer version of this series
[PATCH 01/12] xen/cpupool: add cpu to sched_res_mask when removing it from cpupool
Posted by Juergen Gross 5 years, 3 months ago
When a cpu is removed from a cpupool and added to the free cpus it
should be added to sched_res_mask, too.

The related removal from sched_res_mask in case of core scheduling
is already done in schedule_cpu_add().

As long as all cpupools share the same scheduling granularity there
is nothing going wrong with the missing removal, but this will change
when per-cpupool granularity is fully supported.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index ed973e90ec..f8c81592af 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3189,6 +3189,7 @@ int schedule_cpu_rm(unsigned int cpu)
             /* Adjust cpu masks of resources (old and new). */
             cpumask_clear_cpu(cpu_iter, sr->cpus);
             cpumask_set_cpu(cpu_iter, sr_new[idx]->cpus);
+            cpumask_set_cpu(cpu_iter, &sched_res_mask);
 
             /* Init timer. */
             init_timer(&sr_new[idx]->s_timer, s_timer_fn, NULL, cpu_iter);
-- 
2.26.2


Re: [PATCH 01/12] xen/cpupool: add cpu to sched_res_mask when removing it from cpupool
Posted by Dario Faggioli 5 years, 2 months ago
On Mon, 2020-10-26 at 10:13 +0100, Juergen Gross wrote:
> When a cpu is removed from a cpupool and added to the free cpus it
> should be added to sched_res_mask, too.
> 
> The related removal from sched_res_mask in case of core scheduling
> is already done in schedule_cpu_add().
> 
> As long as all cpupools share the same scheduling granularity there
> is nothing going wrong with the missing removal, 
>
This patch is adding an addition of the CPU to sched_res_mask, which
was missing... So isn't the above "there is nothing going wrong with
the missing addition", or something like that?

Or, if it's an actual missing removal that we are referring to here,
then it must be clarified which one.

> but this will change
> when per-cpupool granularity is fully supported.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
>
With the above fixed or clarified:

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 01/12] xen/cpupool: add cpu to sched_res_mask when removing it from cpupool
Posted by Jürgen Groß 5 years, 2 months ago
On 11.11.20 15:32, Dario Faggioli wrote:
> On Mon, 2020-10-26 at 10:13 +0100, Juergen Gross wrote:
>> When a cpu is removed from a cpupool and added to the free cpus it
>> should be added to sched_res_mask, too.
>>
>> The related removal from sched_res_mask in case of core scheduling
>> is already done in schedule_cpu_add().
>>
>> As long as all cpupools share the same scheduling granularity there
>> is nothing going wrong with the missing removal,
>>
> This patch is adding an addition of the CPU to sched_res_mask, which
> was missing... So isn't the above "there is nothing going wrong with
> the missing addition", or something like that?

Oh yes, of course.

Will fix that.

> 
> Or, if it's an actual missing removal that we are referring to here,
> then it must be clarified which one.
> 
>> but this will change
>> when per-cpupool granularity is fully supported.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>
> With the above fixed or clarified:
> 
> Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

Thanks,


Juergen