From nobody Mon Feb 9 22:24:20 2026 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=1559039752; cv=none; d=zoho.com; s=zohoarc; b=Z5yVhhmZAs1xzhjbAwedUPp5KEzbJF39lMDi98Rf5TmU8hdzVF+qEpPbLg2LObYxwt9Pcm2U1OaUQ2acCHHmwGNVSHgPzcq8VVKku9diUTHh4buLfJIrtjPJFAXkDSVHEP4HWBCode8BxIDQT5EbYmv8FDzQ5q76UBNiwBrINj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1559039752; 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=iSzvM6MCqiBsUZoGu9XewjANcxatytFQvrZLrFp6gNc=; b=eBzQHlWhp4OwVaefQCZI5VT7gef754VWwWdNFF18H/VJKEJES0dzHDJQCrDcZ7gGJv+3rmfQNBpbDt/S6AuvaZu96jvihmfr3lpS3LRx/jmtHeGRUXpjJzCtqLP/UsL/g8f5GbxoWoDE/EIsiu1ETcvdSYvAatU/5FKld6Vvq/Q= 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 1559039752892933.2306905596338; Tue, 28 May 2019 03:35:52 -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 1hVZRA-0006uV-Bs; Tue, 28 May 2019 10:34:32 +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 1hVZQH-0004yt-30 for xen-devel@lists.xenproject.org; Tue, 28 May 2019 10:33:37 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 08adfb80-8134-11e9-914a-c75b1fe74b72; Tue, 28 May 2019 10:33:30 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 498ECB052; Tue, 28 May 2019 10:33:29 +0000 (UTC) X-Inumbo-ID: 08adfb80-8134-11e9-914a-c75b1fe74b72 X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 28 May 2019 12:33:02 +0200 Message-Id: <20190528103313.1343-50-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190528103313.1343-1-jgross@suse.com> References: <20190528103313.1343-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 49/60] 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 --- V1: new patch --- xen/arch/x86/sysctl.c | 3 ++- xen/common/schedule.c | 1 + xen/include/xen/sched.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 3f06fecbd8..034d78fe67 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -200,7 +200,8 @@ long arch_do_sysctl( =20 case XEN_SYSCTL_CPU_HOTPLUG_SMT_ENABLE: case XEN_SYSCTL_CPU_HOTPLUG_SMT_DISABLE: - if ( !cpu_has_htt || boot_cpu_data.x86_num_siblings < 2 ) + if ( !cpu_has_htt || boot_cpu_data.x86_num_siblings < 2 || + sched_disable_smt_switching ) { ret =3D -EOPNOTSUPP; break; diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 3c85861b15..8607262a71 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -57,6 +57,7 @@ integer_param("sched_ratelimit_us", sched_ratelimit_us); =20 /* Number of vcpus per struct sched_unit. */ static unsigned int sched_granularity =3D 1; +bool sched_disable_smt_switching; const cpumask_t *sched_res_mask =3D &cpumask_all; =20 /* Various timer handlers. */ diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index b6496f57f6..7dc63c449b 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -1020,6 +1020,7 @@ static inline bool is_vcpu_online(const struct vcpu *= v) } =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