All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Pierre Morel <pmorel@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	frankja@linux.ibm.com, cohuck@redhat.com, david@redhat.com,
	thuth@redhat.com, imbrenda@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, wintera@linux.ibm.com, seiden@linux.ibm.com,
	nrb@linux.ibm.com, Viktor Mihajlovski <mihajlov@linux.ibm.com>
Subject: Re: [PATCH v9 2/3] s390x: KVM: guest support for topology function
Date: Thu, 19 May 2022 11:36:21 +0200	[thread overview]
Message-ID: <33a53898-c9c4-3292-69ab-90b936371e89@de.ibm.com> (raw)
In-Reply-To: <243a53c0-a988-4013-6d04-a3dfdce8e3f0@linux.ibm.com>



Am 19.05.22 um 11:23 schrieb Pierre Morel:
> 
> 
> On 5/19/22 11:01, Christian Borntraeger wrote:
>>
>>
>> Am 06.05.22 um 11:24 schrieb Pierre Morel:
>>> We let the userland hypervisor know if the machine support the CPU
>>> topology facility using a new KVM capability: KVM_CAP_S390_CPU_TOPOLOGY.
>>>
>>> The PTF instruction will report a topology change if there is any change
>>> with a previous STSI_15_1_2 SYSIB.
>>> Changes inside a STSI_15_1_2 SYSIB occur if CPU bits are set or clear
>>> inside the CPU Topology List Entry CPU mask field, which happens with
>>> changes in CPU polarization, dedication, CPU types and adding or
>>> removing CPUs in a socket.
>>>
>>> The reporting to the guest is done using the Multiprocessor
>>> Topology-Change-Report (MTCR) bit of the utility entry of the guest's
>>> SCA which will be cleared during the interpretation of PTF.
>>>
>>> To check if the topology has been modified we use a new field of the
>>> arch vCPU to save the previous real CPU ID at the end of a schedule
>>> and verify on next schedule that the CPU used is in the same socket.
>>> We do not report polarization, CPU Type or dedication change.
>>
>> I think we should not do this. When PTF returns with "has changed" the guest
>> Linux will rebuild its schedule domains. And this is a really expensive
>> operation as far as I can tell. And the host Linux scheduler WILL schedule
>> too often to other CPUs. So in essence this will result in Linux guests
>> rebuilding their scheduler domains all the time.
>> So remove the "previous CPU logic" for now and only trigger an MTCR when
>> userspace says so.  (eg. on config changes). The idea was to have user
>> defined schedule domains. Following host schedule decisions will be
>> nearly impossible.
> 
> 
> 
> I guess you saw that the MTCR bit is set only if the previous and new CPU are on different sockets, like it is on the hardware, not on every scheduling to another CPU.

Yes, but even that happens too often as far as I can tell.
> 
> However this can easily be done in an enhancement, if ever, since it has no implication on the UAPI.
> I change this for the next round.

Yes, lets defer that (we would need solid measurements).

  reply	other threads:[~2022-05-19  9:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  9:24 [PATCH v9 0/3] s390x: KVM: CPU Topology Pierre Morel
2022-05-06  9:24 ` [PATCH v9 1/3] s390x: KVM: ipte lock for SCA access should be contained in KVM Pierre Morel
2022-05-12  9:08   ` David Hildenbrand
2022-05-16 16:30     ` Pierre Morel
2022-05-12 11:32   ` Janosch Frank
2022-05-16 14:13     ` Pierre Morel
2022-05-06  9:24 ` [PATCH v9 2/3] s390x: KVM: guest support for topology function Pierre Morel
2022-05-12  9:24   ` David Hildenbrand
2022-05-16 14:13     ` Pierre Morel
2022-06-17 14:49       ` Pierre Morel
2022-05-12 11:41   ` Janosch Frank
2022-05-16 10:41     ` Pierre Morel
2022-05-19  9:01   ` Christian Borntraeger
2022-05-19  9:23     ` Pierre Morel
2022-05-19  9:36       ` Christian Borntraeger [this message]
2022-05-06  9:24 ` [PATCH v9 3/3] s390x: KVM: resetting the Topology-Change-Report Pierre Morel
2022-05-12  9:31   ` David Hildenbrand
2022-05-12  9:52     ` Claudio Imbrenda
2022-05-12 10:01       ` David Hildenbrand
2022-05-16 14:21         ` Pierre Morel
2022-05-18 14:33           ` David Hildenbrand
2022-05-18 16:55             ` Pierre Morel
2022-05-16 10:36     ` Pierre Morel
2022-05-18 10:51     ` Pierre Morel
2022-05-18 15:26 ` [PATCH v9 0/3] s390x: KVM: CPU Topology Christian Borntraeger
2022-05-18 16:41   ` Pierre Morel
2022-05-19  5:46   ` Heiko Carstens
2022-05-19  8:07     ` Christian Borntraeger
2022-05-19  9:02       ` 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=33a53898-c9c4-3292-69ab-90b936371e89@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mihajlov@linux.ibm.com \
    --cc=nrb@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=seiden@linux.ibm.com \
    --cc=thuth@redhat.com \
    --cc=wintera@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.