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

Re: [Xen-devel] [PATCH] x86/flush: use APIC ALLBUT destination shorthand when possible


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 31 Dec 2019 13:13:33 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Tue, 31 Dec 2019 12:13:51 +0000
  • Ironport-sdr: 9dxR8avm+x+j5IQvg90xKTi5b0nlhhJRyV3rhtMWYI81eVFkT4swX/nw9XX19XwPFy6Ijorqci B/WO89JWBqDP+yh1OVhFUnEGMJKF1td6F3mnyBurGxx6rCoMudFh8wnJW70t8NBlG2e6WLqaxk khpyt7nlsbH8/ma41Dn87kNOs2hyIGgjsJ9seowTRpcKGknC/iTt+7QVBRPg2Gk/5uSbZsPiDd l2nMd+9SWx4wTAZ+ruE8F8L0W1J7LeLg0tlqnNFN5zgC9CF9JImhqCnhWEolvby26PlgimVwJP X/8=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Dec 27, 2019 at 03:03:57PM +0000, Andrew Cooper wrote:
> On 24/12/2019 12:44, Roger Pau Monne wrote:
> > If the flush mask matches the mask of online CPUs use the APIC ALLBUT
> > destination shorthand in order to send an IPI to all CPUs on the
> > system except the current one. This can only be safely used when no
> > CPU hotplug or unplug operations are taking place, no offline CPUs or
> > those have been onlined and parked and finally when all CPUs in the
> > system have been accounted for (ie: the number of CPUs doesn't exceed
> > NR_CPUS and APIC IDs are below MAX_APICS).
> >
> > This is specially beneficial when using the PV shim, since using the
> > shorthand avoids performing an APIC register write (or multiple ones
> > if using xAPIC mode) for each destination in the flush mask.
> >
> > The lock time on a 32 vCPU guest using the shim without the shorthand
> > is:
> >
> > Global lock flush_lock: addr=ffff82d0804b21c0, lockval=f602f602, not locked
> >   lock:228455938(79406065573135), block:205908580(556416605761539)
> >
> > Average lock time: 347577ns
> >
> > While the same guest using the shorthand:
> >
> > Global lock flush_lock: addr=ffff82d0804b41c0, lockval=d9c4d9bc, cpu=12
> >   lock:1890775(416719148054), block:1663958(2500161282949)
> >
> > Average lock time: 220395ns
> >
> > Approximately a 1/3 improvement in the lock time.
> >
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> 
> While these are good stats, I'm somewhat hesitant about hacking this in
> like this.  For one, it is a substantial amount of ad-hoc logic in
> flush_area_mask()
> 
> Shorthand safety really should be part of the apic driver, not part of
> the TLB logic.

Yes, I've coded it this way because there are already similar APIC
hooks (ie: send_IPI_self). I can merge the shorthand functionality
with send_IPI_mask if that's preferred.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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