All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Emilio G. Cota" <cota@braap.org>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 00/22] tcg: tb_lock removal
Date: Fri, 25 Aug 2017 19:23:02 -0400	[thread overview]
Message-ID: <20170825232302.GA29654@flamenco> (raw)
In-Reply-To: <1502149958-23381-1-git-send-email-cota@braap.org>

On Mon, Aug 07, 2017 at 19:52:16 -0400, Emilio G. Cota wrote:
> This series applies on top of the "multiple TCG contexts" series, v4:
>   https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg06769.html
> 
> Highlights:
> 
> - First, fix a few typos I encountered while working on this (patches 1-3).
>   I could send them separately to qemu-trivial if you prefer.
> - QHT: use a proper cmp function, instead of just checking pointer values
>   to determine equality of matches.
> - Use a binary search tree for each TCG region.
> - Make l1_map lockless by using cmpxchg
> - Introduce page locks (for !user-mode), so that tb_lock is not
>   needed when operating on a page
>   - Introduce page_collection, to lock a range of pages
> - Introduce tb->jmp_lock to protect TB jump lists.
> - Remove tb_lock. User-mode uses just mmap_lock and tb->jmp_lock's;
>   !user-mode uses the same jump locks as well as page locks.
> 
> Performance numbers are in patch 22. We get nice speedups, but I still
> see a lot of idling when booting many cores. I suspect it comes from
> cross-CPU events (e.g. TLB invalidations), but I need to profile it
> better (perf is not good for this; mutrace doesn't quite work). But
> anyway that's for another patchset.

The idling is due to BQL contention related to interrupt handling. In the
case of ARM, this boils down to the GICv3 code being single-threaded.
I don't have time right now to make it multi-threaded, but at least we
know where the scalability bottleneck is.

BTW if there's interest I can submit the lock profiler to the list. The code
is in this branch:
  https://github.com/cota/qemu/tree/lock-profiler
The first commit has sample output: https://github.com/cota/qemu/commit/c5bda634

Also, any feedback on the parent (tb_lock removal) patchset would be appreciated.

To make the 2.11 merge easier, I rebased this patchset (as well as the
multi-tcg-v4 set it is based on) on top of rth's tcg-generic-15, fixing a good
bunch of annoying conflicts. The resulting branch is available at:
  https://github.com/cota/qemu/tree/tcg-generic-15%2Bmulti-tcg-v4-parallel

Thanks,

		Emilio

  parent reply	other threads:[~2017-08-25 23:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07 23:52 [Qemu-devel] [PATCH 00/22] tcg: tb_lock removal Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 01/22] disas/arm: fix 'instuction' typo in comment Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 02/22] linux-user: fix 'finshed' " Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 03/22] translate-all: fix 'consisits' " Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 04/22] qht: fix kernel-doc markup in qht.h Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 05/22] qht: require a default comparison function Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 06/22] qht: return existing entry when qht_insert fails Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 07/22] tcg: track TBs with per-region BST's Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 08/22] tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 09/22] translate-all: introduce iterator macros for tagged TB lists Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 10/22] translate-all: iterate over TBs in a page with page_for_each_tb Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 11/22] translate-all: exit from tb_phys_invalidate if qht_remove fails Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 12/22] translate-all: make l1_map lockless Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 13/22] translate-all: remove hole in PageDesc Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 14/22] translate-all: work page-by-page in tb_invalidate_phys_range_1 Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 15/22] translate-all: move tb_invalidate_phys_page_range up in the file Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 16/22] translate-all: use per-page locking in !user-mode Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 17/22] translate-all: discard TB when tb_link_page returns an existing matching TB Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 18/22] translate-all: protect TB jumps with a per-destination-TB lock Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 19/22] cputlb: remove tb_lock from tlb_flush functions Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 20/22] exec: remove tb_lock from notdirty_mem_write Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 21/22] translate-all: remove tb_lock mention from cpu_restore_state_from_tb Emilio G. Cota
2017-08-07 23:52 ` [Qemu-devel] [PATCH 22/22] tcg: remove tb_lock Emilio G. Cota
2017-08-25 23:23 ` Emilio G. Cota [this message]
2017-10-05 23:48 ` [Qemu-devel] [PATCH 00/22] tcg: tb_lock removal Emilio G. Cota
2017-10-06 10:56   ` Alex Bennée
2017-10-06 17:08     ` 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=20170825232302.GA29654@flamenco \
    --to=cota@braap.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.