WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation fo

To: Olaf Hering <olaf@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
From: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Date: Thu, 24 Mar 2011 15:47:06 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 24 Mar 2011 08:48:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <14ac28e4656d0c235c5e.1300902862@localhost>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1300902861@localhost> <14ac28e4656d0c235c5e.1300902862@localhost>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.

 -George


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel