[CRIU] [PATCH 7/7] ppc64/aarch64: Dynamically define PAGE_SIZE

Dmitry Safonov 0x7f454c46 at gmail.com
Tue Mar 27 14:09:34 MSK 2018


2018-03-27 6:22 GMT+01:00 Mike Rapoport <rppt at linux.vnet.ibm.com>:
> Maybe we could save a couple of cycles with
>
> static unsigned long __page_size;
> static inline page_size(void)
> {
>         if (!__page_size)
>                 __page_size = sysconf(_SC_PAGESIZE);
>         return _page_size;
> }

Yeah, makes sense - I thought of doing something alike, but my wild guess
was that it's how sysconf() does this. And I omitted premature optimization.

But I like your one-function simplicity.. will send v2 with that :)
Possibly moving __page_size somewhere in .c files - otherwise, we'll end up
with a static variable per-object /ö\

-- 
             Dmitry



More information about the CRIU mailing list