From: "Jan Beulich" Subject: Re: heavy P2M lock contention on guest HPET counter reads Date: Mon, 04 Aug 2014 08:00:00 +0100 Message-ID: <53DF4B900200007800028CA2@mail.emea.novell.com> References: <53D8E0540200007800027966@mail.emea.novell.com> <53D91BD30200007800027B61@mail.emea.novell.com> <53DB51EA020000780002843D@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XECFZ-0005TU-Je for xen-devel@lists.xenproject.org; Mon, 04 Aug 2014 07:00:05 +0000 In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andres Lagar Cavilla Cc: xen-devel , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 02.08.14 at 04:33, wrote: > On Fri, Aug 1, 2014 at 2:38 AM, Jan Beulich wrote: > >> >>> On 30.07.14 at 20:15, wrote: >> > Having said that, I don't know off the top of my head that is obviously >> > correct to shortcut the p2m lookup for msix table and iommu. I think so, >> > but... >> >> All internal MMIO ranges are what you'd call "positively decoded" on >> real hardware, i.e. they ought to supersede any other address >> decoding rules anyway. Since they're also not associated with >> possibly varying MFNs, the P2M lookup on them is simply pointless, >> and short-circuiting them is imo at once making better guarantees >> towards consistent behavior. >> > Ok. Good. However: this is a very hot path. I wonder if this iteration can > be made more efficient (i.e sort the resulting mmio regions and do binary > search). How much more efficient would a binary search be for currently five handlers? Furthermore, ->check_handler() involves more than just an address range comparison in at least some of the cases. Jan