From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case Date: Thu, 24 Mar 2011 16:04:12 +0000 Message-ID: References: <1300981626.2648.33.camel@silas> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: 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 , Olaf Hering Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 24/03/2011 15:47, "George Dunlap" wrote: > On Wed, 2011-03-23 at 17:54 +0000, Olaf Hering wrote: >> - t_info_pages = num_online_cpus() * pages + t_info_first_offset; >> - t_info_pages *= sizeof(uint32_t); >> - t_info_pages /= PAGE_SIZE; >> - if ( t_info_pages % PAGE_SIZE ) >> - t_info_pages++; >> + t_info_bytes = num_online_cpus() * pages + t_info_first_offset; >> + t_info_bytes *= sizeof(uint32_t); >> + t_info_pages = PFN_UP(t_info_bytes); > > Hmm, still not quite following the spirit of the idea -- that > t_info_bytes should be bytes, not words (as it is in the first > instance). I think I'd prefer making it one assignment: > > t_info_bytes = ( num_online_cpus() * pages + t_info_first_offset ) > * sizeof(uint32_t); > > But if you don't like that, to keep consistent, we should do this: > t_info_words = num_online_cpus() * pages + t_info_first_offset; > t_info_bytes = t_info_words * sizeof(uint32_t); > t_info_pages = PFN_UP(t_info_bytes); > > Then it's really clear when looking at it what the inputs and outputs of > each line is supposed to be. I'll clean this up and apply the whole series. -- Keir > -George > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel