From: "Emilio G. Cota" <cota@braap.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v5 2/3] tcg: introduce dynamic TLB sizing
Date: Mon, 17 Dec 2018 17:41:33 -0500 [thread overview]
Message-ID: <20181217224133.GA17293@flamenco> (raw)
In-Reply-To: <20181214174233.18027-3-cota@braap.org>
On Fri, Dec 14, 2018 at 12:42:32 -0500, Emilio G. Cota wrote:
> +static void tlb_mmu_resize_locked(CPUArchState *env, int mmu_idx)
> +{
> + CPUTLBDesc *desc = &env->tlb_d[mmu_idx];
> + size_t old_size = tlb_n_entries(env, mmu_idx);
> + size_t rate;
> + size_t new_size = old_size;
(snip)
> + if (desc->n_used_entries > desc->window.max_entries) {
> + desc->window.max_entries = desc->n_used_entries;
> + }
> + rate = desc->window.max_entries * 100 / old_size;
> +
> + if (rate == 100) {
> + new_size = MIN(old_size << 2, 1 << CPU_TLB_DYN_MAX_BITS);
> + } else if (rate > 70) {
> + new_size = MIN(old_size << 1, 1 << CPU_TLB_DYN_MAX_BITS);
I won't resend a v6 until v5 gets any comments, but I just
want to point out that after doing some more benchmarking,
quadrupling the size here is unnecessary; in fact, perf is 1% better
on average if we just double the TLB size when rate > 70.
Emilio
next prev parent reply other threads:[~2018-12-17 22:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 17:42 [Qemu-devel] [PATCH v5 0/3] Dynamic TLB sizing Emilio G. Cota
2018-12-14 17:42 ` [Qemu-devel] [PATCH v5 1/3] cputlb: do not evict empty entries to the vtlb Emilio G. Cota
2018-12-14 17:42 ` [Qemu-devel] [PATCH v5 2/3] tcg: introduce dynamic TLB sizing Emilio G. Cota
2018-12-17 22:41 ` Emilio G. Cota [this message]
2018-12-26 6:51 ` Richard Henderson
2018-12-14 17:42 ` [Qemu-devel] [PATCH v5 3/3] tcg/i386: enable " Emilio G. Cota
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181217224133.GA17293@flamenco \
--to=cota@braap.org \
--cc=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).