]> git.proxmox.com Git - mirror_qemu.git/commit - accel/tcg/translate-all.c
translate-all: use per-page locking in !user-mode
authorEmilio G. Cota <cota@braap.org>
Thu, 27 Jul 2017 00:22:51 +0000 (20:22 -0400)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 15 Jun 2018 17:42:55 +0000 (07:42 -1000)
commit0b5c91f74f3c83a36f37740969df8c775c997e69
treeb40f7bcd0f1ff33f63a59c9e6f2112a12b55ef4e
parent45c73de594414904b0d6a7ade70fb4514d35f79c
translate-all: use per-page locking in !user-mode

Groundwork for supporting parallel TCG generation.

Instead of using a global lock (tb_lock) to protect changes
to pages, use fine-grained, per-page locks in !user-mode.
User-mode stays with mmap_lock.

Sometimes changes need to happen atomically on more than one
page (e.g. when a TB that spans across two pages is
added/invalidated, or when a range of pages is invalidated).
We therefore introduce struct page_collection, which helps
us keep track of a set of pages that have been locked in
the appropriate locking order (i.e. by ascending page index).

This commit first introduces the structs and the function helpers,
to then convert the calling code to use per-page locking. Note
that tb_lock is not removed yet.

While at it, rename tb_alloc_page to tb_page_add, which pairs with
tb_page_remove.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/translate-all.c
accel/tcg/translate-all.h
include/exec/exec-all.h