Richard Henderson <richard.hender...@linaro.org> writes:
> On 2/26/20 10:10 AM, Alex Bennée wrote: >> While 32mb is certainly usable a full system boot ends up flushing the >> codegen buffer nearly 100 times. Increase the default on 64 bit hosts >> to take advantage of all that spare memory. After this change I can >> boot my tests system without any TB flushes. > >> +#if TCG_TARGET_REG_BITS == 32 >> #define DEFAULT_CODE_GEN_BUFFER_SIZE_1 (32 * MiB) >> +#else >> +#define DEFAULT_CODE_GEN_BUFFER_SIZE_1 (2 * GiB) >> +#endif > > This particular number, I'm not so sure about. > > It makes sense for a lone vm, running in system mode, on a large-ish host. > It's more questionable for a large-ish host running many system mode vm's, > although one can tune that from the command-line, so perhaps it's > still ok. Yeah it would be nice to get some feedback from users. I suspect system emulation means the mmap is less efficient due to the sharding of the translation buffer. > It does not make sense for a linux-user chroot, running make -jN, on just > about > any host. For linux-user, I could be happy with a modest increase, but not > all > the way out to 2GiB. > > Discuss. Does it matter that much? Surely for small programs the kernel just never pages in the used portions of the mmap? That said does linux-user have a better idea of the size of the problem set before we start running? Could we defer calling tcg_exec_init until we have mapped in the main executable and then size based on that? > > > r~ -- Alex Bennée