From: "wangyanan (Y)" <wangyanan55@huawei.com>
To: Andrew Jones <drjones@redhat.com>
Cc: Barry Song <song.bao.hua@hisilicon.com>,
Peter Maydell <peter.maydell@linaro.org>,
"Michael S . Tsirkin" <mst@redhat.com>,
wanghaibin.wang@huawei.com, qemu-devel@nongnu.org,
yangyicong@huawei.com, Shannon Zhao <shannon.zhaosl@gmail.com>,
qemu-arm@nongnu.org, Alistair Francis <alistair.francis@wdc.com>,
prime.zeng@hisilicon.com, Igor Mammedov <imammedo@redhat.com>,
yuzenghui@huawei.com, Paolo Bonzini <pbonzini@redhat.com>,
zhukeqian1@huawei.com, Jiajie Li <lijiajie11@huawei.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [RFC PATCH v2 2/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse
Date: Thu, 6 May 2021 15:04:14 +0800 [thread overview]
Message-ID: <7fbaedf0-6f21-e131-198d-d39500460ce0@huawei.com> (raw)
In-Reply-To: <20210430104927.do6cxs6yw6yqlq6e@gator.home>
Hi Drew,
On 2021/4/30 18:49, Andrew Jones wrote:
> On Fri, Apr 30, 2021 at 05:33:42PM +0800, wangyanan (Y) wrote:
>> On 2021/4/30 15:01, Andrew Jones wrote:
>>> On Fri, Apr 30, 2021 at 08:41:25AM +0200, Andrew Jones wrote:
>>>> On Fri, Apr 30, 2021 at 01:09:00PM +0800, wangyanan (Y) wrote:
>>>>> But I think the requirement for ARM "if even one parameter other than cpus
>>>>> or maxcpus
>>>>> is provided then all parameters must be provided" will be better. This can
>>>>> ensure the
>>>>> whole accurate users-specified topology. As you mentioned, if anybody who
>>>>> bothers
>>>>> to specify one, why not also specify the others.
>>>>>
>>>>> I can add the requirement for ARM in the documentation, and also check the
>>>>> parameters
>>>>> in virt_smp_parse. Will this be fine?
>>>> We sort of have to support command lines that are missing 'maxcpus' and
>>>> 'clusters', unless we work together with libvirt to make the change.
>>>> Currently libvirt will generate '-smp 16,sockets=16,cores=1,threads=1'
>>>> from '<vcpu placement='static'>16</vcpu>'. That's sufficient for our
>>>> stricter, but not completely strict requirements. And, I still think
>>>> 'threads' could be optional, because there's a good chance the user
>>>> doesn't want to describe them, so a default of 1 is good enough. Also,
>>>> given maxcpus, but not cpus, it's pretty obvious that cpus should equal
>>>> maxcpus.
>>>>
>>> We also still need just 'cpus' or just 'maxcpus' to work, since that
>>> already works now. So, at least these should work
>>>
>>> -smp N
>>> -smp maxcpus=N
>>> -smp N,maxcpus=M
>>> -smp N,sockets=N,cores=1,threads=1
>>> -smp N,maxcpus=M,sockets=M,cores=1,threads=1
>>>
>>> since they work today, even though no topology is described.
>> Yes. I forgot this point that we should consider the compat.
>>> If we want to
>>> describe a topology for the first three, then we'll have to pick one,
>>> which brings us back to the sockets over cores stuff. Or, we could choose
>>> to just not generate topology descriptions when none is provided.
>> I find that both preferring cores over sockets and not generating topology
>> descriptions
>> when none is provided can't solve everything. We can only ensure guest will
>> get one
>> socket with multiple cores with qemu cmdline "-smp N".
>>
>> But if we specify N cpus without any other parameters in libvirt xml, a qemu
>> cmdline like
>> "-smp N, sockets=N, cores=1,threads=1" will be generated, and as a result
>> guest will get
>> N sockets. In this case, we still can't avoid the silent change.
>>
>> So maybe we should just prefer sockets over cores like the general
>> smp_parse() and libvirt,
>> and let users use "-smp N, sockets=1, cores=N,threads=1" to get what they
>> want if they
>> use version 6.0 or later.
> Rather than doing the preference of sockets over cores thing, let's
> require that sockets, cores, and one of maxcpus or cpus are provided,
> as we discussed in the other mail.
Ok, I see.
Thanks for these discussions about parsing of -smp command line. :)
Now it seems that a separate virt_smp_parse() function for ARM is still
necessary,
I will implement it in v3 of the other "Introduce cpu topology support"
series.
Thanks,
Yanan
>
> Thanks,
> drew
>
> .
next prev parent reply other threads:[~2021-05-06 7:05 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 8:31 [RFC PATCH v2 0/4] hw/arm/virt: Introduce cluster cpu topology support Yanan Wang
2021-04-13 8:31 ` [RFC PATCH v2 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu Yanan Wang
2021-04-28 10:23 ` Andrew Jones
2021-04-29 1:22 ` wangyanan (Y)
2021-04-13 8:31 ` [RFC PATCH v2 2/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse Yanan Wang
2021-04-28 10:31 ` Andrew Jones
2021-04-29 2:14 ` wangyanan (Y)
2021-04-29 7:16 ` Andrew Jones
2021-04-29 8:56 ` wangyanan (Y)
2021-04-29 11:02 ` Andrew Jones
2021-04-30 5:09 ` wangyanan (Y)
2021-04-30 6:41 ` Andrew Jones
2021-04-30 7:01 ` Andrew Jones
2021-04-30 9:33 ` wangyanan (Y)
2021-04-30 10:49 ` Andrew Jones
2021-05-06 7:04 ` wangyanan (Y) [this message]
2021-04-30 8:59 ` wangyanan (Y)
2021-04-30 10:48 ` Andrew Jones
2021-04-13 8:31 ` [RFC PATCH v2 3/4] hw/arm/virt-acpi-build: Add cluster level for PPTT table Yanan Wang
2021-04-28 10:41 ` Andrew Jones
2021-04-13 8:31 ` [RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree Yanan Wang
2021-04-28 10:46 ` Andrew Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7fbaedf0-6f21-e131-198d-d39500460ce0@huawei.com \
--to=wangyanan55@huawei.com \
--cc=alistair.francis@wdc.com \
--cc=david@gibson.dropbear.id.au \
--cc=drjones@redhat.com \
--cc=imammedo@redhat.com \
--cc=lijiajie11@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=prime.zeng@hisilicon.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=shannon.zhaosl@gmail.com \
--cc=song.bao.hua@hisilicon.com \
--cc=wanghaibin.wang@huawei.com \
--cc=yangyicong@huawei.com \
--cc=yuzenghui@huawei.com \
--cc=zhukeqian1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).