From: Ian Jackson Subject: Re: [RFC PATCH] xen: comment opaque expression in __page_to_virt Date: Fri, 31 Aug 2012 15:36:41 +0100 Message-ID: <20544.52217.717066.788945@mariner.uk.xensource.com> References: <20542.14593.18652.74782@mariner.uk.xensource.com> <5040B4510200007800097CBD@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5040B4510200007800097CBD@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Jan Beulich writes ("Re: [RFC PATCH] xen: comment opaque expression in __page_to_virt"): > No, that's not precise. There's really not much of a win to be had > on 32-bit (division by 3 and division by 24 (sizeof(struct page_info)) > should be the same in speed. > > The win is on x86-64, where sizeof(struct page_info) is a power > of 2, and hence the pair of shifts (right, then left) can be reduced > to a single one. > > Yet (for obvious reasons) the code ought to not break anything > if even on x86-64 the size of the structure would change, hence > it needs to be that complex (and can't be broken into separate, > simpler implementations for 32- and 64-bits). Thanks. Do you want to post a revised version of my patch or shall I do so ? (If so please confirm that I should put your s-o-b on it for your wording above.) Ian.