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

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

To: George Dunlap <george.dunlap@xxxxxxxxxxxxx>, Olaf Hering <olaf@xxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
From: Keir Fraser <keir.xen@xxxxxxxxx>
Date: Thu, 24 Mar 2011 16:04:12 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 24 Mar 2011 09:06:41 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:user-agent:date:subject:from:to:cc:message-id :thread-topic:thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=w09yEa9X5Jrfrim2r8kmXW63QG/1QtN3edTcBIVIxY8=; b=a6axpzs2eefyWG7QOM4BZw5/e1gH8QT5YP2yhCzVAI5LR5J8HDHqz7G8CNiWHUQVLP XfUnHNINtYhbGFxa+/S1U3hkFcJ4HZunOi05JUO/QzYSwmjWu021gC9q2EJ/a2ugjBSK ANLre96MszvTKXnyJZxBETJ1H1ERgnqoSS9rI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=c6c9ivsmfADw7nMv+jrnDMQzw9k7gXr+hhiwsnhGax+44CTMAPp95x9Qn3N3ABK8kH aCOJ7a4YJ/w6egu4uyZvWPtu+D7j+PxGVBMhzWy4xz5kiJ08IhdTbGcuaNcritan2Uvo nmXb5sYzbDW6CRZSwQUNwJrVIImjL1UwekBxI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1300981626.2648.33.camel@silas>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcvqPR2O66Uf+POv80qqWPx4alAH0g==
Thread-topic: [Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case
User-agent: Microsoft-Entourage/12.28.0.101117
On 24/03/2011 15:47, "George Dunlap" <george.dunlap@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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