[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 43/45] tcg: introduce regions to split code_g
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH v2 43/45] tcg: introduce regions to split code_gen_buffer |
Date: |
Tue, 18 Jul 2017 13:44:38 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Mon, Jul 17, 2017 at 19:09:28 -1000, Richard Henderson wrote:
> On 07/16/2017 10:04 AM, Emilio G. Cota wrote:
> >+#ifdef CONFIG_SOFTMMU
> >+/*
> >+ * It is likely that some vCPUs will translate more code than others, so we
> >+ * first try to set more regions than smp_cpus, with those regions being
> >+ * larger than the minimum code_gen_buffer size. If that's not possible we
> >+ * make do by evenly dividing the code_gen_buffer among the vCPUs.
> >+ */
> >+void softmmu_tcg_region_init(void)
> >+{
> >+ size_t i;
> >+
> >+ /* Use a single region if all we have is one vCPU thread */
> >+ if (smp_cpus == 1 || !qemu_tcg_mttcg_enabled()) {
> >+ tcg_region_init(0);
> >+ return;
> >+ }
> >+
> >+ for (i = 8; i > 0; i--) {
> >+ size_t regions_per_thread = i;
> >+ size_t region_size;
> >+
> >+ region_size = tcg_init_ctx.code_gen_buffer_size;
> >+ region_size /= smp_cpus * regions_per_thread;
> >+
> >+ if (region_size >= 2 * MIN_CODE_GEN_BUFFER_SIZE) {
> >+ tcg_region_init(smp_cpus * regions_per_thread);
> >+ return;
> >+ }
> >+ }
> >+ tcg_region_init(smp_cpus);
> >+}
> >+#endif
>
> Any reason this code wouldn't just live in tcg_region_init?
> It would certainly simplify the interface.
Good point. Will move it there, adding a comment to make sure the
function is called once qemu_tcg_mttcg_enabled() has been set up.
E.
- [Qemu-devel] [PATCH v2 15/45] target/arm: check CF_PARALLEL instead of parallel_cpus, (continued)
- [Qemu-devel] [PATCH v2 31/45] tci: move tci_regs to tcg_qemu_tb_exec's stack, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 43/45] tcg: introduce regions to split code_gen_buffer, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 24/45] exec-all: introduce TB_PAGE_ADDR_FMT, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 25/45] translate-all: define and use DEBUG_TB_INVALIDATE_GATE, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 34/45] tcg: define tcg_init_ctx and make tcg_ctx a pointer, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 21/45] tcg: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16