diff mbox series

[2/2] qemu-options: Add missing "sockets=2" to CLI "-smp 2"

Message ID 20210928093157.14620-3-wangyanan55@huawei.com
State New
Headers show
Series qemu-options: Trivial doc fixes related to -smp | expand

Commit Message

wangyanan (Y) Sept. 28, 2021, 9:31 a.m. UTC
There is one example of -smp CLI in qemu-options.hx currently
using "-smp 2" and assuming that there will be 2 sockets.
However now the actually calculation logic of missing sockets
and cores is not immutable, we should use more explicit CLIs
like "-smp 2,sockets=2" if we want multiple sockets.

Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
---
 qemu-options.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé Sept. 28, 2021, 10:46 a.m. UTC | #1
On 9/28/21 11:31, Yanan Wang wrote:
> There is one example of -smp CLI in qemu-options.hx currently
> using "-smp 2" and assuming that there will be 2 sockets.
> However now the actually calculation logic of missing sockets
> and cores is not immutable, we should use more explicit CLIs
> like "-smp 2,sockets=2" if we want multiple sockets.
> 
> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> ---
>  qemu-options.hx | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-options.hx b/qemu-options.hx
> index dcd9595650..ff8917c5e1 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -395,7 +395,7 @@ SRST
>          -m 2G \
>          -object memory-backend-ram,size=1G,id=m0 \
>          -object memory-backend-ram,size=1G,id=m1 \
> -        -smp 2 \
> +        -smp 2,sockets=2,maxcpus=2 \

Is the addition of "maxcpus=2" intentional?

>          -numa node,nodeid=0,memdev=m0 \
>          -numa node,nodeid=1,memdev=m1,initiator=0 \
>          -numa cpu,node-id=0,socket-id=0 \
>
wangyanan (Y) Sept. 28, 2021, 10:58 a.m. UTC | #2
On 2021/9/28 18:46, Philippe Mathieu-Daudé wrote:
> On 9/28/21 11:31, Yanan Wang wrote:
>> There is one example of -smp CLI in qemu-options.hx currently
>> using "-smp 2" and assuming that there will be 2 sockets.
>> However now the actually calculation logic of missing sockets
>> and cores is not immutable, we should use more explicit CLIs
>> like "-smp 2,sockets=2" if we want multiple sockets.
>>
>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>> ---
>>   qemu-options.hx | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/qemu-options.hx b/qemu-options.hx
>> index dcd9595650..ff8917c5e1 100644
>> --- a/qemu-options.hx
>> +++ b/qemu-options.hx
>> @@ -395,7 +395,7 @@ SRST
>>           -m 2G \
>>           -object memory-backend-ram,size=1G,id=m0 \
>>           -object memory-backend-ram,size=1G,id=m1 \
>> -        -smp 2 \
>> +        -smp 2,sockets=2,maxcpus=2 \
> Is the addition of "maxcpus=2" intentional?
Yes, but it's not necessary IMO. I just wanted to keep consistency
with other numa config examples in the Doc. Should I remove it ?

Thanks,
Yanan
>>           -numa node,nodeid=0,memdev=m0 \
>>           -numa node,nodeid=1,memdev=m1,initiator=0 \
>>           -numa cpu,node-id=0,socket-id=0 \
>>
> .
Daniel P. Berrangé Sept. 28, 2021, 11:01 a.m. UTC | #3
On Tue, Sep 28, 2021 at 06:58:20PM +0800, wangyanan (Y) wrote:
> 
> On 2021/9/28 18:46, Philippe Mathieu-Daudé wrote:
> > On 9/28/21 11:31, Yanan Wang wrote:
> > > There is one example of -smp CLI in qemu-options.hx currently
> > > using "-smp 2" and assuming that there will be 2 sockets.
> > > However now the actually calculation logic of missing sockets
> > > and cores is not immutable, we should use more explicit CLIs
> > > like "-smp 2,sockets=2" if we want multiple sockets.
> > > 
> > > Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
> > > ---
> > >   qemu-options.hx | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/qemu-options.hx b/qemu-options.hx
> > > index dcd9595650..ff8917c5e1 100644
> > > --- a/qemu-options.hx
> > > +++ b/qemu-options.hx
> > > @@ -395,7 +395,7 @@ SRST
> > >           -m 2G \
> > >           -object memory-backend-ram,size=1G,id=m0 \
> > >           -object memory-backend-ram,size=1G,id=m1 \
> > > -        -smp 2 \
> > > +        -smp 2,sockets=2,maxcpus=2 \
> > Is the addition of "maxcpus=2" intentional?
> Yes, but it's not necessary IMO. I just wanted to keep consistency
> with other numa config examples in the Doc. Should I remove it ?

I think it makes sense to be explicit, because the numa config
works in terms of maxcpus when splitting cpus between nodes


Regards,
Daniel
wangyanan (Y) Sept. 28, 2021, 11:42 a.m. UTC | #4
On 2021/9/28 19:01, Daniel P. Berrangé wrote:
> On Tue, Sep 28, 2021 at 06:58:20PM +0800, wangyanan (Y) wrote:
>> On 2021/9/28 18:46, Philippe Mathieu-Daudé wrote:
>>> On 9/28/21 11:31, Yanan Wang wrote:
>>>> There is one example of -smp CLI in qemu-options.hx currently
>>>> using "-smp 2" and assuming that there will be 2 sockets.
>>>> However now the actually calculation logic of missing sockets
>>>> and cores is not immutable, we should use more explicit CLIs
>>>> like "-smp 2,sockets=2" if we want multiple sockets.
>>>>
>>>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>>>> ---
>>>>    qemu-options.hx | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>>> index dcd9595650..ff8917c5e1 100644
>>>> --- a/qemu-options.hx
>>>> +++ b/qemu-options.hx
>>>> @@ -395,7 +395,7 @@ SRST
>>>>            -m 2G \
>>>>            -object memory-backend-ram,size=1G,id=m0 \
>>>>            -object memory-backend-ram,size=1G,id=m1 \
>>>> -        -smp 2 \
>>>> +        -smp 2,sockets=2,maxcpus=2 \
>>> Is the addition of "maxcpus=2" intentional?
>> Yes, but it's not necessary IMO. I just wanted to keep consistency
>> with other numa config examples in the Doc. Should I remove it ?
> I think it makes sense to be explicit, because the numa config
> works in terms of maxcpus when splitting cpus between nodes
The statement of this numa config example actually assume that
there will be 2 cpus totally. Although based on behavior of the
smp parser we will get maxcpus=2, I also tend to keep it explicitly.

But I should update subject of this patch and the commit message.

Thanks,
Yanan
Philippe Mathieu-Daudé Sept. 28, 2021, 11:49 a.m. UTC | #5
On 9/28/21 13:42, wangyanan (Y) wrote:
> 
> On 2021/9/28 19:01, Daniel P. Berrangé wrote:
>> On Tue, Sep 28, 2021 at 06:58:20PM +0800, wangyanan (Y) wrote:
>>> On 2021/9/28 18:46, Philippe Mathieu-Daudé wrote:
>>>> On 9/28/21 11:31, Yanan Wang wrote:
>>>>> There is one example of -smp CLI in qemu-options.hx currently
>>>>> using "-smp 2" and assuming that there will be 2 sockets.
>>>>> However now the actually calculation logic of missing sockets
>>>>> and cores is not immutable, we should use more explicit CLIs
>>>>> like "-smp 2,sockets=2" if we want multiple sockets.
>>>>>
>>>>> Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
>>>>> ---
>>>>>    qemu-options.hx | 2 +-
>>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>>>> index dcd9595650..ff8917c5e1 100644
>>>>> --- a/qemu-options.hx
>>>>> +++ b/qemu-options.hx
>>>>> @@ -395,7 +395,7 @@ SRST
>>>>>            -m 2G \
>>>>>            -object memory-backend-ram,size=1G,id=m0 \
>>>>>            -object memory-backend-ram,size=1G,id=m1 \
>>>>> -        -smp 2 \
>>>>> +        -smp 2,sockets=2,maxcpus=2 \
>>>> Is the addition of "maxcpus=2" intentional?
>>> Yes, but it's not necessary IMO. I just wanted to keep consistency
>>> with other numa config examples in the Doc. Should I remove it ?
>> I think it makes sense to be explicit, because the numa config
>> works in terms of maxcpus when splitting cpus between nodes
> The statement of this numa config example actually assume that
> there will be 2 cpus totally. Although based on behavior of the
> smp parser we will get maxcpus=2, I also tend to keep it explicitly.
> 
> But I should update subject of this patch and the commit message.

Once updated:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
diff mbox series

Patch

diff --git a/qemu-options.hx b/qemu-options.hx
index dcd9595650..ff8917c5e1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -395,7 +395,7 @@  SRST
         -m 2G \
         -object memory-backend-ram,size=1G,id=m0 \
         -object memory-backend-ram,size=1G,id=m1 \
-        -smp 2 \
+        -smp 2,sockets=2,maxcpus=2 \
         -numa node,nodeid=0,memdev=m0 \
         -numa node,nodeid=1,memdev=m1,initiator=0 \
         -numa cpu,node-id=0,socket-id=0 \