[PATCH 0/2] osdep: Cache getpagesize() call in qemu_real_host_page_size()

Philippe Mathieu-Daudé posted 2 patches 1 week, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251103105111.68294-1-philmd@linaro.org
include/qemu/osdep.h |  6 +-----
util/osdep.c         | 11 +++++++++++
2 files changed, 12 insertions(+), 5 deletions(-)
[PATCH 0/2] osdep: Cache getpagesize() call in qemu_real_host_page_size()
Posted by Philippe Mathieu-Daudé 1 week, 5 days ago
Cache getpagesize() call once, so we don't have to worry
how often we can call qemu_real_host_page_size() and
qemu_real_host_page_mask().

Philippe Mathieu-Daudé (2):
  osdep: Un-inline qemu_real_host_page_size()
  osdep: Cache getpagesize() call in qemu_real_host_page_size()

 include/qemu/osdep.h |  6 +-----
 util/osdep.c         | 11 +++++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)

-- 
2.51.0


Re: [PATCH 0/2] osdep: Cache getpagesize() call in qemu_real_host_page_size()
Posted by Richard Henderson 1 week, 2 days ago
On 11/3/25 11:51, Philippe Mathieu-Daudé wrote:
> Cache getpagesize() call once, so we don't have to worry
> how often we can call qemu_real_host_page_size() and
> qemu_real_host_page_mask().
> 
> Philippe Mathieu-Daudé (2):
>    osdep: Un-inline qemu_real_host_page_size()
>    osdep: Cache getpagesize() call in qemu_real_host_page_size()

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

That's a step up, certainly.  I had been thinking of making it a faux const variable, akin 
to how we manage page-vary-common.c, and a high priority constructor.

With less efford you could mark the function __attribute__((const)), so that the compiler 
will CSE calls.


r~