qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] ppc/pnv: fix cores per chip for multiple cpus


From: Nikunj A Dadhania
Subject: Re: [Qemu-ppc] [PATCH] ppc/pnv: fix cores per chip for multiple cpus
Date: Fri, 22 Sep 2017 16:36:02 +0530

Cédric Le Goater <address@hidden> writes:

> On 09/22/2017 08:00 AM, Nikunj A Dadhania wrote:
>> David Gibson <address@hidden> writes:
>> 
>>>>>>
>>>>>> As smp_thread defaults to 1 in vl.c, similarly smp_cores also has the
>>>>>> default value of 1 in vl.c. In powernv, we were setting nr-cores like
>>>>>> this:
>>>>>>
>>>>>>         object_property_set_int(chip, smp_cores, "nr-cores", 
>>>>>> &error_fatal);
>>>>>>
>>>>>> Even when there were multiple cpus (-smp 4), when the guest boots up, we
>>>>>> just get one core (i.e. smp_cores was 1) with single thread(smp_threads
>>>>>> was 1), which is wrong as per the command-line that was provided.
>>>>>
>>>>> Right, so, -smp 4 defaults to 4 sockets, each with 1 core of 1
>>>>> thread.  If you can't supply 4 sockets you should error, but you
>>>>> shouldn't go and change the number of cores per socket.
>>>>
>>>> OK, that makes sense now. And I do see that smp_cpus is 4 in the above
>>>> case. Now looking more into it, i see that powernv has something called
>>>> "num_chips", isnt this same as sockets ? Do we need num_chips separately?
>>>
>>> Ah, yes, I see.  It's probably still reasonable to keep num_chips as
>>> an internal variable, rather than using (smp_cpus / smp_cores /
>>> smp_threads) everywhere.  But we shouldn't have it as a direct
>>> user-settable property, instead setting it from the -smp command line
>>> option.
>> 
>> Something like the below works till num_chips=2, after that guest does
>> not boot up. This might be some limitation within the OS, Cedric might
>> have some clue. Otherwise, I see that multiple chips are created with
>> single core having single thread.
>> 
>>     ppc/pnv: Use num_chips for multiple sockets
>>     
>>     When the user does not provide the cpu topology, e.g. "-smp 4", machine 
>> fails to
>>     initialize 4 cpus. QEMU assumes smp_threads and smp_cores both as 1. 
>> Make sure
>>     that we initialize multiple chips for this.
>
> -smp 4          would give a machine with 4 sockets with 1 core
> -smp 4,cores=4  would give a machine with 1 socket  with 4 cores
>
> correct ?

Yes

Regards
Nikunj




reply via email to

[Prev in Thread] Current Thread [Next in Thread]