Re: [PATCH 11/32] Replace qemu_real_host_page variables with inlined functions

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

 



marcandre.lureau@xxxxxxxxxx wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
>
> Replace the global variables with inlined helper functions. getpagesize() is very
> likely annotated with a "const" function attribute (at least with glibc), and thus
> optimization should apply even better.
>
> This avoids the need for a constructor initialization too.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

I see what you are tyring to do here.

But once here, why aren't we just calling getpagesize() and call it a
day?  I can't see what advantage has to have this other name for this
function, and as you are already changing all its uses anyways.

Once there, I can see that qemu_real_host_page_mask is used (almost)
everywhere as (vfio code use the real value):

    foo & qemu_real_host_page_mask()

or

    foo & ~qemu_real_host_page_mask()

And no, I don't have any good names for this macros.

Anyways, if you don't like the suggestion, your changes are better that
we already have, so ...

Reviewed-by: Juan Quintela <quintela@xxxxxxxxxx>





[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