From nobody Tue Nov 11 08:28:55 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569820976; cv=none; d=zoho.com; s=zohoarc; b=NUwha9wDUu0H+x0Gha66MRNjwMl3GiQV2iGxpxFLbV0USp+mwaMYu8JlwAhIbS3//UYfRV0LrHNq1tvtxb92C747rqOkTiU/WpHfNsHCbSiF85y4SYhRhuCJkoDtKBX/XczGwsPnC8R3trJOwEGU461KNvOvF1pc6F3N6cFhAEg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569820976; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=1rcn478HlGHF1o+OfL0om000jwo7QhWZVsMLVBxIse4=; b=SpTh4hFYDTj4cIeJcyTfA9C1vKnXKi2PMkp9O+iSaT/sS+bwnzAiPzjEVo0aZ/VrhqHM++6w6hZU5sTAfLUJPoYOllff9OmCmMPElJaL4GBJy+X8pj8HTzRNoribtAvUqL3YCFGIHA/qVwDiwoEyFjhV/Gad3NGkewMrYfe74SE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569820976033114.96304867185347; Sun, 29 Sep 2019 22:22:56 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEo8E-00021b-Cj; Mon, 30 Sep 2019 05:21:58 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iEo8D-00020w-IR for xen-devel@lists.xenproject.org; Mon, 30 Sep 2019 05:21:57 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by localhost (Halon) with ESMTPS id 3121f678-e342-11e9-96c8-12813bfff9fa; Mon, 30 Sep 2019 05:21:44 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0C9A3B0CC; Mon, 30 Sep 2019 05:21:42 +0000 (UTC) X-Inumbo-ID: 3121f678-e342-11e9-96c8-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Mon, 30 Sep 2019 07:21:27 +0200 Message-Id: <20190930052135.11257-12-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190930052135.11257-1-jgross@suse.com> References: <20190930052135.11257-1-jgross@suse.com> Subject: [Xen-devel] [PATCH v5 11/19] xen/sched: reject switching smt on/off with core scheduling active X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Dario Faggioli , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Acked-by: Jan Beulich Acked-by: Dario Faggioli --- V1: - new patch V2: - EBUSY as return code (Jan Beulich, Dario Faggioli) - __read_mostly for sched_disable_smt_switching (Jan Beulich) --- 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 =3D -EOPNOTSUPP; break; } + if ( sched_disable_smt_switching ) + { + ret =3D -EBUSY; + break; + } plug =3D op =3D=3D XEN_SYSCTL_CPU_HOTPLUG_SMT_ENABLE; fn =3D smt_up_down_helper; hcpu =3D _p(plug); diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 249ff8a882..0dcf004d78 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -63,6 +63,7 @@ integer_param("sched_ratelimit_us", sched_ratelimit_us); =20 /* Number of vcpus per struct sched_unit. */ static unsigned int __read_mostly sched_granularity =3D 1; +bool __read_mostly sched_disable_smt_switching; const cpumask_t *sched_res_mask =3D &cpumask_all; =20 /* 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 doma= in *d) } =20 extern bool sched_smt_power_savings; +extern bool sched_disable_smt_switching; =20 extern enum cpufreq_controller { FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel