qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [SeaBIOS PATCH 2/2] allow CPUs to have non-contiguous L


From: Avi Kivity
Subject: Re: [Qemu-devel] [SeaBIOS PATCH 2/2] allow CPUs to have non-contiguous Local APIC IDs (v2)
Date: Thu, 26 Jul 2012 19:08:19 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 07/26/2012 06:07 PM, Eduardo Habkost wrote:
> On Thu, Jul 26, 2012 at 05:55:09PM +0300, Avi Kivity wrote:
>> On 07/26/2012 05:16 PM, Eduardo Habkost wrote:
>> >> > 
>> >> > It's possible to replace the atomic read of CountCPUs with the bitmap 
>> >> > weight
>> >> > calculation on the loop, but: is it really worth it?
>> >> > 
>> >> Why not? This eliminates one more global state.
>> > 
>> > Maybe we can simply make it stop being global and be used only by the
>> > smp.c initialization code?
>> > 
>> > Even if the variable didn't exist yet, I think I would add it myself:
>> > it's simpler and more efficient to calculate the bitmap weight once,
>> > while filling the bitmap, than recalculating it every time on the
>> > while(cmos_smp_count) loop.
>> 
>> So you're spinning more efficiently?
> 
> No, coding more efficiently. I'm lazy. :-)
> 
> I don't want to risk breaking that part of the code to save 2 bytes of
> memory. It's possible to impement it reliably, yes, but it's also very
> easy to introduce a subtle bug, so why touch something that works
> perfectly just to save 2 bytes?

Like gleb, I prefer avoiding derived state which can get out-of-sync.


-- 
error compiling committee.c: too many arguments to function





reply via email to

[Prev in Thread] Current Thread [Next in Thread]