[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>
- Re: [PATCH 08/32] osdep: poison {HOST,TARGET}_WORDS_BIGENDIAN, (continued)
- [PATCH 07/32] Replace TARGET_WORDS_BIGENDIAN, marcandre . lureau, 2022/03/23
- [PATCH 09/32] include/qapi: add g_autoptr support for qobject types, marcandre . lureau, 2022/03/23
- [PATCH 10/32] tests: replace free_all() usage with g_auto, marcandre . lureau, 2022/03/23
- [PATCH 12/32] qga: replace deprecated g_get_current_time(), marcandre . lureau, 2022/03/23
- [PATCH 11/32] Replace qemu_real_host_page variables with inlined functions, marcandre . lureau, 2022/03/23
- Re: [PATCH 11/32] Replace qemu_real_host_page variables with inlined functions,
Juan Quintela <=
- [PATCH 14/32] util: rename qemu-error.c to match its header name, marcandre . lureau, 2022/03/23
- [PATCH 13/32] error-report: replace deprecated g_get_current_time() with glib >= 2.62, marcandre . lureau, 2022/03/23
- [PATCH 15/32] error-report: use error_printf() for program prefix, marcandre . lureau, 2022/03/23
- [PATCH 16/32] include: move TFR to osdep.h, marcandre . lureau, 2022/03/23
- [PATCH 18/32] include: move qemu_pipe() to osdep.h, marcandre . lureau, 2022/03/23
- [PATCH 17/32] include: move qemu_write_full() declaration to osdep.h, marcandre . lureau, 2022/03/23
- [PATCH 19/32] include: move coroutine IO functions to coroutine.h, marcandre . lureau, 2022/03/23
- [PATCH 20/32] include: move dump_in_progress() to runstate.h, marcandre . lureau, 2022/03/23
- [PATCH 21/32] include: move C/util-related declarations to cutils.h, marcandre . lureau, 2022/03/23