Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CD59C43331 for ; Tue, 24 Mar 2020 14:55:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 304C920774 for ; Tue, 24 Mar 2020 14:55:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 304C920774 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1jGkxu-0002Ub-N4; Tue, 24 Mar 2020 14:55:38 +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 1jGkxt-0002UW-4z for xen-devel@lists.xenproject.org; Tue, 24 Mar 2020 14:55:37 +0000 X-Inumbo-ID: 8410ba18-6ddf-11ea-843a-12813bfff9fa Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 8410ba18-6ddf-11ea-843a-12813bfff9fa; Tue, 24 Mar 2020 14:55:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EFFEEAB6D; Tue, 24 Mar 2020 14:55:33 +0000 (UTC) Message-ID: <52ae93739b1176f535fabff8932230edbfa6ce7d.camel@suse.com> From: Dario Faggioli To: =?ISO-8859-1?Q?J=FCrgen_Gro=DF?= , Sergey Dyasli Date: Tue, 24 Mar 2020 15:55:32 +0100 In-Reply-To: References: <1585056853121.58010@citrix.com> Organization: SUSE Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-bl2TbDq3pW1aEZWtjyGf" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Subject: Re: [Xen-devel] xl vcpu-pin peculiarities in core scheduling mode 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: Wei Liu , Andrew Cooper , George Dunlap , Jan Beulich , "xen-devel@lists.xenproject.org" , Ian Jackson , Roger Pau Monne Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" --=-bl2TbDq3pW1aEZWtjyGf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 2020-03-24 at 15:22 +0100, J=C3=BCrgen Gro=C3=9F wrote: > On 24.03.20 14:34, Sergey Dyasli wrote: > > I did some experiments and noticed > > the following > > inconsistencies: > >=20 > > 1. xl vcpu-pin 5 0 0 > > Windows 10 (64-bit) (1) 5 0 0 =20 > > -b- 1644.0 0 / all > > Windows 10 (64-bit) (1) 5 1 1 =20 > > -b- 1650.1 0 / all > > ^ =20 > > ^ > > CPU 1 doesn't match reported hard-affinity of 0. Should this > > command set > > hard-affinity of vCPU 1 to 1? Or should it be 0-1 for both > > vCPUs instead? > >=20 I think this is fine. For improving how this is reported back to users, I'd go for the solution nr 3 proposed by Juergen (below). > > 2. xl vcpu-pin 5 0 1 > > libxl: error: libxl_sched.c:62:libxl__set_vcpuaffinity: > > Domain 5:Setting vcpu affinity: Invalid argument > > This is expected but perhaps needs documenting somewhere? > >=20 Not against more clear error reporting. It would mean that libxl must have a way to tell that pinning failed because pinning was not being done to a "master CPU". I guess it's doable, but perhaps it's not the top priority, assuming we have (and we put in place, if we still don't) good documentation on how pinning works in this operational mode. That would make a good article/blog post, I think. > > 3. xl vcpu-pin 5 0 1-2 > > Windows 10 (64-bit) (1) 5 0 2 =20 > > -b- 1646.7 1-2 / all > > Windows 10 (64-bit) (1) 5 1 3 =20 > > -b- 1651.6 1-2 / all > > ^ =20 > > ^^^ > > Here is a CPU / affinity mismatch again, but the more > > interesting fact > > is that setting 1-2 is allowed at all, I'd expect CPU would > > never be set > > to 1 with such settings. > >=20 This is the situation I'm most concerned of. Mostly, because I think a user might be surprised to see the command (1) not failing and (2) having the effect that it has. I think that, in this case, we should either fail, or adjust the affinity to 2-3. If we do the latter, we should inform the user about that. There's something similar in libxl already (related to soft and hard affinity, where we set a mask, then we check what's been actually setup by Xen and act accordingly). Thoughts? I'd go for a mix of 1 and 3, i.e., I'd do: > 1. As today, documenting the output. > Not very nice IMO, but the least effort. >=20 This, i.e., we definitely need more documentation and we need to make sure it's visible enough. > 2. Just print one line for each virtual cpu/core/socket, like: > Windows 10 (64-bit) (1) 5 0-1 0-1 -b- 1646.7 0-1 / > all > This has the disadvantage of dropping the per-vcpu time in favor > of > per-vcore time, OTOH this is reflecting reality. >=20 > 3. Print the effective pinnings: > Windows 10 (64-bit) (1) 5 0 0 -b- 1646.7 0 / > all > Windows 10 (64-bit) (1) 5 1 1 -b- 1646.7 1 / > all > Should be rather easy to do. >=20 And this: i.e., I'd always report the effective mapping. I actually would go as far as changing the mapping we've been given and store the effective one(s) in `cpu_hard_affinity`, etc, in Xen. Of course, as said above, we'd need to inform the user that this has happened. Regards --=20 Dario Faggioli, Ph.D http://about.me/dario.faggioli Virtualization Software Engineer SUSE Labs, SUSE https://www.suse.com/ ------------------------------------------------------------------- <> (Raistlin Majere) --=-bl2TbDq3pW1aEZWtjyGf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEES5ssOj3Vhr0WPnOLFkJ4iaW4c+4FAl56H2QACgkQFkJ4iaW4 c+7M2w/+It4LSH+yVIo8OHhy1geiAoEURYJSrFeQpnojn9o28BsgXW0EcLxFGifO IP+I1NK6w2om5DNUlbrPsoB7YEq0GTiQNofXyV3yAKKzWLYp5zlsztid2BTyIPtR O+eclT+D1UYurVvwnKE3CSxJDzq6G71SsjKfKQTWO5+aW4ge/zVKhACSd6ZYDFfP K7kI+v7QPRZJOtSt/9ZIK0kBMmXLaXvDjuxOE2qkhPh3TVjLTJKCw5wsx48vF0OL zo5NgHG7EniTt6tTpvKk5f3uQHhIlE8aZt7S+A1PhaYJDkQruZp1BGyipIeCei5p hSTh/hyjpzoUgs6bBTmfTM3++zEYLU7CoQeBGn6kmdIHyVXIudux6PPys4ZMEfgk hXtaNYgkMLq9LIyMCllxBdd6aPJZeaeeQwVN7RjQoWptPPY3N0Fr592Hxoyqmni4 CoVlItpwrgtrcDawKvR1//e6rPuK5fagsGnhz4NUdz7CA45ApDbb0SNicuYvU7jo bGjd0Tj5l0a5oknxooVm5iUgOAuKKFp5gTvmG2JtatoEsfijML07twM8slMgIiW0 6fehzQhxjbmxwgTkq02a4iYZmRriFJ9NjBPvGyptwDd0RWoOR9uZ2QQoVOQkr8wY sTpaG2VU3taRmyaptvixPoTky8b/6DNWSc74pZz1ym2yAjCUFa4= =DwEX -----END PGP SIGNATURE----- --=-bl2TbDq3pW1aEZWtjyGf--