qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] TCG region page guards and transparent huge pages


From: Richard Henderson
Subject: Re: [Qemu-devel] TCG region page guards and transparent huge pages
Date: Thu, 14 Jun 2018 10:06:43 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/13/2018 03:54 PM, Emilio G. Cota wrote:
> So, what to do based on all this?
> 
> I think the current implementation makes sense. That said, two
> things we could consider doing are:

Thanks for checking.


> - Remove the guard pages. I'd rather keep them in though, since
>   their cost is negligible in most scenarios. If we really wanted
>   to recover this performance, we could just enable the guards
>   (by calling mprotect) only under TCG_DEBUG.
> 
> - Change tcg_n_regions() to assign larger regions. I am not convinced
>   of this, since at most we'd gain 3% in performance, but we might
>   end up wasting more space (recall that not all vCPUs translate
>   code at the same rate), or flushing more often (probably with
>   a perf impact larger than 3%).

If we change anything at all, my preference would be to simply remove the guard
pages.  We have other asserts that pre-date the guard pages that should prevent
us from tromping on the next region -- the program should have crashed with
SIGABRT before hitting the guard page -- so I'm not especially worried about
dropping them.

And while it doesn't apply to x86-64, other hosts have even huger huge pages,
so IMO it does make sense to prefer a contiguous region when talking about such
a large allocation.

Does anyone else have an opinion here?


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]