From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case Date: Thu, 24 Mar 2011 17:03:27 +0100 Message-ID: <20110324160327.GA27980@aepfle.de> References: <14ac28e4656d0c235c5e.1300902862@localhost> <1300981626.2648.33.camel@silas> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <1300981626.2648.33.camel@silas> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, Mar 24, George Dunlap wrote: > Then it's really clear when looking at it what the inputs and outputs of > each line is supposed to be. George, lets not overdo things. The formula I came up with, based on the initial code, is even slightly incorrect. It may allocate more than needed. Each cpu has some pages/mfns stored as uint32_t. That list is stored with an offset at tinfo. So its more like: num_online_cpus() * pages * sizeof(uint32_t) + t_info_first_offset; And that number of bytes is now correctly converted to pages with PFN_UP. t_info_words = num_online_cpus() * pages * sizeof(uint32_t); t_info_pages = PFN_UP(t_info_first_offset + t_info_words); (Modulo things I missed.) Olaf