Re: [PATCH -v3] KVM: x86: lapic: Clean up find_highest_vector() and count_vectors()

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

 



On Wed, Sep 05, 2012 at 06:40:26PM +0900, Takuya Yoshikawa wrote:
> On Wed, 5 Sep 2012 12:26:49 +0300
> "Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:
> 
> > It's not guaranteed if another thread can modify the bitmap.
> > Is this the case here? If yes we need at least ACCESS_ONCE.
> 
> In this patch, using the wrapper function to read out a register
> value forces compilers not to do bad things.

It's not robust. Compiler is free to optimize it out, and it
frequently does that.

> But I agree that it is not a good API.
> 
> I would like to use fls() rather than ACCESS_ONCE if it's
> really needed.

Sure, makes sense.

> > > Anyway, I'm now thinking that we do not care about such
> > > things here, and can just follow your advice, yes?
> > 
> > Unless you see an issue with it ...
> 
> Although I read the code, I'm not sure.
> 
> But this code is apparently not so critical for performance
> that we can simply use fls().

Yes. I guess if it becomes critical we'll need to add a cache anyway.

> If I can remove likely() and use proper macros, that's enough
> for me.

Me too.

> Thanks,
> 	Takuya
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux