[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case


  • To: George Dunlap <george.dunlap@xxxxxxxxxxxxx>, Olaf Hering <olaf@xxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcvqPR2O66Uf+POv80qqWPx4alAH0g==
  • Thread-topic: [Xen-devel] Re: [PATCH 1 of 5] xentrace: fix t_info_pages calculation for the default case

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.