[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen staging] xen/sched: reject switching smt on/off with core scheduling active
commit c4598b3d945bf64be181efc2e63132a432d73172 Author: Juergen Gross <jgross@xxxxxxxx> AuthorDate: Wed Oct 2 09:27:36 2019 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Fri Oct 4 12:59:45 2019 +0200 xen/sched: reject switching smt on/off with core scheduling active 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@xxxxxxxx> Acked-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Dario Faggioli <dfaggioli@xxxxxxxx> --- xen/arch/x86/sysctl.c | 5 +++++ xen/common/schedule.c | 1 + xen/include/xen/sched.h | 1 + 3 files changed, 7 insertions(+) diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 3742ede61b..4a76f0f47f 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -209,6 +209,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 ab9b573a92..3fa2f21a34 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -63,6 +63,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 f97303668a..aa8257edc9 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1037,6 +1037,7 @@ static inline bool is_iommu_enabled(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 -- generated by git-patchbot for /home/xen/git/xen.git#staging _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |