From: "Jan Beulich" Subject: Re: [PATCH v2 03/23] x86: zero BSS using stosl instead of stosb Date: Wed, 22 Jul 2015 04:04:29 -0600 Message-ID: <55AF86CD0200007800093EC3@prv-mh.provo.novell.com> References: <1437402558-7313-1-git-send-email-daniel.kiper@oracle.com> <1437402558-7313-4-git-send-email-daniel.kiper@oracle.com> <55AE2F0C02000078000938D2@prv-mh.provo.novell.com> <20150721182300.GK3479@olila.local.net-space.pl> <55AF35A502000078000D4F8E@prv-mh.provo.novell.com> <55AF578F.4070403@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZHqt8-0000vn-6b for xen-devel@lists.xenproject.org; Wed, 22 Jul 2015 10:04:34 +0000 In-Reply-To: <55AF578F.4070403@citrix.com> 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: Andrew Cooper Cc: xen-devel@lists.xenproject.org, daniel.kiper@oracle.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 22.07.15 at 10:42, wrote: > In the case of having aligned source and destination on a 16-byte > boundary (which we can trivially arrange), then ERMSB (to give it its > Intel name) and rep stosl differ only in the setup cost; they still > scale at the same rate for changes in length. > > Therefore, assuming we arrange for 16-byte alignment, using rep stosl > would appear to be a single 60ish cycle hit over using ERMSB, but would > be substantially more efficient than using rep stosb on a non-ERMSB system. > > Overall, I think 16 byte alignment and rep stosl is the best compromise. Or leaving such code alone, with the assumption that over time the setup cost (on a growing number of systems) outweighs the benefits (on a shrinking set). Jan