qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>
Cc: thuth@redhat.com, ehabkost@redhat.com, david@redhat.com,
	richard.henderson@linaro.org, qemu-devel@nongnu.org,
	armbru@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com,
	qemu-s390x@nongnu.org, pbonzini@redhat.com, eblake@redhat.com
Subject: Re: [PATCH v1 1/9] s390x: smp: s390x dedicated smp parsing
Date: Tue, 20 Jul 2021 09:37:24 +0200	[thread overview]
Message-ID: <da1ebcb0-e9a2-13cd-fb53-4846f75efe25@linux.ibm.com> (raw)
In-Reply-To: <YPWfol5y2pdK9mtC@redhat.com>



On 7/19/21 5:52 PM, Daniel P. Berrangé wrote:
> On Mon, Jul 19, 2021 at 05:43:29PM +0200, Cornelia Huck wrote:
>> (restored cc:s)
>>
>> On Fri, Jul 16 2021, Pierre Morel <pmorel@linux.ibm.com> wrote:
>>
>>> On 7/16/21 11:14 AM, Daniel P. Berrangé wrote:
>>>> I increasingly worry that we're making a mistake by going down the
>>>> route of having custom smp_parse implementations per target, as this
>>>> is showing signs of inconsistent behaviour and error reportings. I
>>>> think the differences / restrictions have granularity at a different
>>>> level that is being tested in many cases too.
>>>>
>>>> Whether threads != 1 is valid will likely vary depending on what
>>>> CPU model is chosen, rather than what architecture is chosen.
>>>> The same is true for dies != 1. We're not really checking this
>>>> closely even in x86 - for example I can request nonsense such
>>>> as a 25 year old i486 CPU model with hyperthreading and multiple
>>>> dies
>>>>
>>>>     qemu-system-x86_64 -cpu 486 -smp 16,cores=4,dies=2,threads=2
>>
>> Now that's what I'd call an upgrade :)
>>
>>>>
>>>> In this patch, there is no error reporting if the user specifies
>>>> dies != 1 or threads != 1 - it just silently ignores the request
>>>> which is not good.
>>>
>>> yes, I should change this
>>>
>>>>
>>>> Some machine types may have constraints on CPU sockets.
>>>>
>>>> This can of course all be handled by custom smp_parse impls, but
>>>> this is ultimately going to lead to alot of duplicated and
>>>> inconsistent logic I fear.
>>>>
>>>> I wonder if we would be better off having machine class callback
>>>> that can report topology constraints for the current configuration,
>>>> along lines ofsmp_constraints(MachineState *ms,
>>>>
>>>>        smp_constraints(MachineState *ms,
>>>>                        int *max_sockets,
>>>>                        int *max_dies,
>>>>                        int *max_cores,
>>>>                        int *max_threads)
>>>
>>> I find the idee good, but what about making it really machine agnostic
>>> by removing names and using a generic
>>>
>>> 	smp_constraints(MachineState *ms,
>>> 			int *nb_levels,
>>> 			int *levels[]
>>> 			);
>>>
>>> Level can be replaced by another name like container.
>>> The machine could also provide the level/container names according to
>>> its internal documentation.
>>
>> In theory, this could give us more flexibility; however, wouldn't
>> that still mean that the core needs to have some knowledge of the
>> individual levels? We also have the command line parsing to consider,
>> and that one uses concrete names (which may or may not make sense,
>> depending on what machine you are trying to configure), and we'd still
>> have to map these to 'levels'.
> 
> Yeah, we need to deal with names in several places, so I don't think
> abstracting it in one place is desirable, as it introduces the need
> to convert between the two and potentially obscures the semantics.
> 

Converting with names looks possible to me, every architecture can 
export a topology_name array or structure indicating names and other 
informations like the maximum possible count of entries at this level.

We have now the SMPConfiguration, couldn't we use it for this?

Regards,
Pierre

> 
> Regards,
> Daniel
> 

-- 
Pierre Morel
IBM Lab Boeblingen


  reply	other threads:[~2021-07-20  7:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14 16:53 [PATCH v1 0/9] s390x: CPU Topology Pierre Morel
2021-07-14 16:53 ` [PATCH v1 1/9] s390x: smp: s390x dedicated smp parsing Pierre Morel
2021-07-16  8:54   ` Cornelia Huck
2021-07-16  9:14     ` Daniel P. Berrangé
2021-07-16 10:59       ` Pierre Morel
     [not found]       ` <e4865ad6-f8ec-e7ba-66ef-9c95334ba9b3@linux.ibm.com>
2021-07-19 15:43         ` Cornelia Huck
2021-07-19 15:52           ` Daniel P. Berrangé
2021-07-20  7:37             ` Pierre Morel [this message]
2021-07-20  8:33               ` Pierre Morel
2021-07-16 10:47     ` Pierre Morel
2021-07-14 16:53 ` [PATCH v1 2/9] s390x: toplogy: adding drawers and books to " Pierre Morel
2021-07-15  6:16   ` Markus Armbruster
2021-07-15  8:19     ` Pierre Morel
2021-07-15 10:48       ` Markus Armbruster
2021-07-16  9:10         ` Cornelia Huck
2021-07-16  9:18           ` Daniel P. Berrangé
2021-07-16 10:44             ` Cornelia Huck
2021-07-16 10:49               ` Daniel P. Berrangé
2021-07-19 15:50                 ` Cornelia Huck
2021-07-20  7:52                   ` Pierre Morel
2021-07-20  8:20                     ` Cornelia Huck
2021-07-20  8:46                       ` Pierre Morel
2021-07-20  9:00                         ` Cornelia Huck
2021-07-20  9:19                         ` Daniel P. Berrangé
2021-07-20 12:29                           ` Pierre Morel
2021-07-16  9:23     ` Daniel P. Berrangé
2021-07-16 11:08       ` Pierre Morel
2021-07-14 16:53 ` [PATCH v1 3/9] s390x: cpu topology: CPU topology objects and structures Pierre Morel
2021-07-14 16:53 ` [PATCH v1 4/9] s390x: Topology list entries and SYSIB 15.x.x Pierre Morel
2021-07-14 16:53 ` [PATCH v1 5/9] s390x: topology: implementating Store Topology System Information Pierre Morel
2021-07-14 16:53 ` [PATCH v1 6/9] s390x: kvm: topology: interception of PTF instruction Pierre Morel
2021-07-16  9:22   ` Cornelia Huck
2021-07-16 11:23     ` Pierre Morel
2021-07-16 11:56       ` Cornelia Huck
2021-07-14 16:53 ` [PATCH v1 7/9] s390x: SCLP: reporting the maximum nested topology entries Pierre Morel
2021-07-16  9:24   ` Cornelia Huck
2021-07-16 11:12     ` Pierre Morel
2021-07-14 16:53 ` [PATCH v1 8/9] s390x: numa: define drawers and books for NUMA Pierre Morel
2021-07-14 16:53 ` [PATCH v1 9/9] s390x: numa: implement NUMA for S390x Pierre Morel

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=da1ebcb0-e9a2-13cd-fb53-4846f75efe25@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.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).