[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/32] Replace qemu_real_host_page variables with inlined fun
From: |
Juan Quintela |
Subject: |
Re: [PATCH 11/32] Replace qemu_real_host_page variables with inlined functions |
Date: |
Fri, 25 Mar 2022 09:34:33 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> 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@redhat.com>
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@redhat.com>