Message ID | 20190914085251.18816-40-jgross@suse.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | xen: add core scheduling support | expand |
On Sat, 2019-09-14 at 10:52 +0200, Juergen Gross wrote: > When core or socket scheduling are active enabling or disabling smt > is > not possible as that would require a major host reconfiguration. > > Add a bool sched_disable_smt_switching which will be set for core or > socket scheduling. > > Signed-off-by: Juergen Gross <jgross@suse.com> > Acked-by: Jan Beulich <jbeulich@suse.com> > Acked-by: Dario Faggioli <dfaggioli@suse.com> Regards
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 50be0c722a..e2ef60d2e7 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -206,6 +206,11 @@ long arch_do_sysctl( ret = -EOPNOTSUPP; break; } + if ( sched_disable_smt_switching ) + { + ret = -EBUSY; + break; + } plug = op == XEN_SYSCTL_CPU_HOTPLUG_SMT_ENABLE; fn = smt_up_down_helper; hcpu = _p(plug); diff --git a/xen/common/schedule.c b/xen/common/schedule.c index e360c9ec9f..e5b7678dc0 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -57,6 +57,7 @@ integer_param("sched_ratelimit_us", sched_ratelimit_us); /* Number of vcpus per struct sched_unit. */ static unsigned int __read_mostly sched_granularity = 1; +bool __read_mostly sched_disable_smt_switching; const cpumask_t *sched_res_mask = &cpumask_all; /* Common lock for free cpus. */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index f276ec9398..e943b06646 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1040,6 +1040,7 @@ static inline bool is_xenstore_domain(const struct domain *d) } extern bool sched_smt_power_savings; +extern bool sched_disable_smt_switching; extern enum cpufreq_controller { FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen