Re: [Qemu-devel] [RFC 6/6] cputlb: dynamically resize TLBs based on use rate

2018-10-08 Thread Emilio G. Cota
On Sun, Oct 07, 2018 at 21:48:34 -0400, Emilio G. Cota wrote: > - 70/40% use rate for growing/shrinking the TLB does not > seem a great choice, if one wants to avoid a pathological > case that can induce constant resizing. Imagine we got > exactly 70% use rate, and all TLB misses were compuls

Re: [Qemu-devel] [RFC 6/6] cputlb: dynamically resize TLBs based on use rate

2018-10-07 Thread Richard Henderson
On 10/6/18 2:45 PM, Emilio G. Cota wrote: > @@ -122,6 +123,39 @@ size_t tlb_flush_count(void) > return count; > } > > +/* Call with tlb_lock held */ > +static void tlb_mmu_resize_locked(CPUArchState *env, int mmu_idx) > +{ > +CPUTLBDesc *desc = &env->tlb_desc[mmu_idx]; > +size_t rat

Re: [Qemu-devel] [RFC 6/6] cputlb: dynamically resize TLBs based on use rate

2018-10-07 Thread Emilio G. Cota
On Sun, Oct 07, 2018 at 19:37:50 +0200, Philippe Mathieu-Daudé wrote: > On 10/6/18 11:45 PM, Emilio G. Cota wrote: > > 2. System boot + shutdown, ubuntu 18.04 x86_64: > > You can also run the VM tests to build QEMU: > > $ make vm-test Thanks, will give that a look. > > +if (rate == 100) { >

Re: [Qemu-devel] [RFC 6/6] cputlb: dynamically resize TLBs based on use rate

2018-10-07 Thread Philippe Mathieu-Daudé
Hi Emilio, On 10/6/18 11:45 PM, Emilio G. Cota wrote: > Perform the resizing only on flushes, otherwise we'd > have to take a perf hit by either rehashing the array > or unnecessarily flushing it. > > We grow the array aggressively, and reduce the size more > slowly. This accommodates mixed workl

[Qemu-devel] [RFC 6/6] cputlb: dynamically resize TLBs based on use rate

2018-10-06 Thread Emilio G. Cota
Perform the resizing only on flushes, otherwise we'd have to take a perf hit by either rehashing the array or unnecessarily flushing it. We grow the array aggressively, and reduce the size more slowly. This accommodates mixed workloads, where some processes might be memory-heavy while others are n