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

Re: [PATCH] x86/x2apic: introduce a mixed physical/cluster mode


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 30 Oct 2023 17:34:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sQg8h0NKIXYmbrbgWzJEBlL60OwNyl7e/y8fpoDn7f4=; b=n9MmZU7aeiu8Dob140SKUAOer8X3Ypy14qzg+h4vVip/raRH2Xk0oulvjTpn5FEfeHF4+lqkRDxB/PnF0TYqb6pSzEQa7mHwEd7aWXmopANH4ZS2f3B3DP1DHLfYuMG8qeXStTQew7OkmnBT7h+T8efI4aRrghLu7BaepdfMj6J1jUqI9RktnNUf9S6X+ZHb2nFlS8D/we9xjTJsrYw6yrEebeRwyVq+7uR84EX68ce42s6TSn0qmtR+/Hjufgik42gDwDmlogLN3k06jqawLl94ToL70T/yCGUp3HTFROBfJcV5szcIwmXq4AykvzvW9gxPOPzahI4tQ8yTS9gDjw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ba24XC6svDCLnVWEJy08p/IC1xmgokJej8whPjuOb/XWJxJYX+QeEu/uGFsUVhFbEQNgUkazWyHEQ0pQYaT5DKM8oOybWiFE1iRtM5Z3KwOGavOX4kArAgIVZFcZFtoD5V5xLbNDOC4dosoA8AwklP4F43pMXcVGQR8UuuJ8dUp32x2+FfNTPw2xEV6iDK0cVYasuGV8Y1rFiWs7XocLDxbBsFCER//J/HrMfrPpW2k5NI/USTOnmBlrWfURn80SsspfINn2H/QK7c4WOGxXE/UXNzzPEi9Po88dA7Ek2opLJyL1xG/rsUAt6try+F3Zkp0TSOkBG/Q2G6kb7Ysp4g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 30 Oct 2023 16:34:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.10.2023 17:10, Roger Pau Monné wrote:
> On Mon, Oct 30, 2023 at 03:32:56PM +0100, Jan Beulich wrote:
>> On 24.10.2023 15:51, Roger Pau Monne wrote:
>>> The current implementation of x2APIC requires to either use Cluster Logical 
>>> or
>>> Physical mode for all interrupts.  However the selection of Physical vs 
>>> Logical
>>> is not done at APIC setup, an APIC can be addressed both in Physical or 
>>> Logical
>>> destination modes concurrently.
>>>
>>> Introduce a new x2APIC mode called mixed, which uses Logical Cluster mode 
>>> for
>>> IPIs, and Physical mode for external interrupts, thus attempting to use the
>>> best method for each interrupt type.
>>>
>>> Using Physical mode for external interrupts allows more vectors to be used, 
>>> and
>>> interrupt balancing to be more accurate.
>>>
>>> Using Logical Cluster mode for IPIs allows less accesses to the ICR register
>>> when sending those, as multiple CPUs can be targeted with a single ICR 
>>> register
>>> write.
>>>
>>> A simple test calling flush_tlb_all() 10000 times in a tight loop on a 96 
>>> CPU
>>> box gives the following average figures:
>>>
>>> Physical mode: 26617931ns
>>> Mixed mode:    23865337ns
>>>
>>> So ~10% improvement versus plain Physical mode.
>>
>> Nice.
>>
>>>  Note that Xen uses Cluster
>>> mode by default, and hence is already using the fastest way for IPI 
>>> delivery at
>>> the cost of reducing the amount of vectors available system-wide.
>>>
>>> Make the newly introduced mode the default one.
>>>
>>> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>>> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>>> ---
>>> Do we want to keep a full Logical Cluster mode available?  I don't see a 
>>> reason
>>> to target external interrupts in Logical Cluster mode, but maybe there's
>>> something I'm missing.
>>>
>>> It's not clear to me whether the ACPI FADT flags are meant to apply only to
>>> external interrupt delivery mode, or also to IPI delivery.  If
>>> ACPI_FADT_APIC_PHYSICAL is only meant to apply to external interrupts and 
>>> not
>>> IPIs then we could possibly get rid of physical mode IPI delivery.
>>>
>>> Still need to put this under XenServer extensive testing, but wanted to get
>>> some feedback before in case approach greatly changes.
>>
>> Looks quite okay, just a couple of minor remarks:
> 
> Thanks.
> 
> Do we still want to keep the pure cluster mode?

I think we should keep it for a full release cycle or two.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.