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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Nov 2023 17:22:02 +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=2rAObDEDL1ynZezy8jMvZAdzISo3aJpqWQbI79H4Voo=; b=DSkVb27zfq6oEq42WSS/brqJCEb99P+fMYFG4SeGE73r2nHOyCzF4ssKc7irj9e3KXHlBaw0712xiv3ZE2scdrnZD3GTkCr10PzLxbWdKccQ2NMZWk8PPAcDft4Xnf84auzS/aARMVLKNe1lnulNyxjY4CInpvm8+OSMN075Rl7l14t6w2lUj9hPiAKfCrWIQhhdaYLwCQaHa3FuqS5ef49u2t044GqgjB+j9tCZiGh7wD+KSFOJYKoHl5ztgvdjTZaxBzMb6tpRKPnWkWEl9KjHhlO8QYxdNuT0ib2u0mBlPPGH+mzXCUEbFipkOuduzggdup2JK98MWi/S4SNbbA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZXEedkAaEM6Rulcbs4IP3UGTbS1Q4Wdf82lLwhZLi+puVBneNLEt0fHSy9ifm7oGrjCesT8nS/662uHYKriu8/5EysSmzekG+LmT82ZKQtvi+jPM3Tv0H8AtsJfkl99RrGz6VcTFj0FVC8vWLMZ5L3zWKod+awzvRaknrfzBX3rbRAI7B1TfmDlbm2EEn0usQ4qqYMAMejqEWJXhPSqEDY7Y4OxObHklA2BYSVyDQo4MPMtsUkOj/ivjY3VgcT1hS4wdxYQmvf60JNhIZ8pQUejNHnBmzRXDBvr860btxL99MC9Kwk8SRe9aJY5JH8MotqOu0/e8HxIEmC/Fs8CNZw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry Wang <Henry.Wang@xxxxxxx>, Community Manager <community.manager@xxxxxxxxxxxxxx>, 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, 06 Nov 2023 16:22:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.11.2023 15:27, 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 fewer 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 on a tight loop on AMD EPYC
> 9754 with 512 CPUs gives the following figures in nano seconds:
> 
> x mixed
> + phys
> * cluster
>     N           Min           Max        Median           Avg        Stddev
> x  25 3.5131328e+08 3.5716441e+08 3.5410987e+08 3.5432659e+08     1566737.4
> +  12  1.231082e+09  1.238824e+09 1.2370528e+09 1.2357981e+09     2853892.9
> Difference at 95.0% confidence
>       8.81472e+08 +/- 1.46849e+06
>       248.774% +/- 0.96566%
>       (Student's t, pooled s = 2.05985e+06)
> *  11 3.5099276e+08 3.5561459e+08 3.5461234e+08 3.5415668e+08     1415071.9
> No difference proven at 95.0% confidence
> 
> So Mixed has no difference when compared to Cluster mode, and Physical mode is
> 248% slower when compared to either Mixed or Cluster modes with a 95%
> confidence.
> 
> 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.
> 
> Note the printing of the APIC addressing mode done in connect_bsp_APIC() has
> been removed, as with the newly introduced mixed mode this would require more
> fine grained printing, or else would be incorrect.  The addressing mode can
> already be derived from the APIC driver in use, which is printed by different
> helpers.
> 
> Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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