From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Emilio G. Cota" <cota@braap.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
MTTCG Devel <mttcg@listserver.greensocs.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Sergey Fedorov <serge.fdrv@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v6 00/15] tb hash improvements
Date: Wed, 08 Jun 2016 07:25:33 +0100 [thread overview]
Message-ID: <87inxkgpsy.fsf@linaro.org> (raw)
In-Reply-To: <1464138802-23503-1-git-send-email-cota@braap.org>
Emilio G. Cota <cota@braap.org> writes:
> v5: https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg02366.html
>
> v6 applies cleanly on top of tcg-next (8b1fe3f4 "cpu-exec:
> Clean up 'interrupt_request' reloading", tagged "pull-tcg-20160512").
Emilio,
How is v7 going? I only mention it because we are starting to discuss
feature freeze for 2.7 and I'm pretty keen to get QHT merged before
then.
Richard,
How happy are you with this series so far? Are you planning to take in
via your tree when ready?
>
> Changes from v5, mostly from Sergey's review:
>
> - processor.h: use #ifdef #elif throughout the file
>
> - tb_hash_func: use uint32 for 'flags' param
>
> - tb_hash_func5: do 'foo >> 32' instead of 'foo >> 31 >> 1', since foo
> is a u64.
>
> - thread.h:
> * qemu_spin_locked: remove acquire semantics; simply use atomic_read().
> * qemu_spin_trylock: return bool instead of 0 or -EBUSY; this saves
> a branch.
> * qemu_spin:
> + use __sync_lock_test_and_set and __sync_lock_release; drop
> the patches touching atomic.h.
> + add unlikely() hint to "while (test_and_set)"; this gives a small
> speedup under no contention.
>
> - qht:
> * merge the parallel-writes patch into the QHT patch.
> [Richard: I dropped your reviewed-by since the patch changed
> quite a bit.]
> * drop unneeded #includes from qht.h
> * document qht.h using kerneldoc.
> * use unsigned int for storing the seqlock version.
> * fix a couple of typos in the comments at the top of qht.c.
> * explain better the "no duplicated pointer" policy: while trying to
> insert an already-existing hash-pointer pair is OK (insert will
> just return false), it's not OK to insert different hash-pointer
> pairs that share the same pointer value, but not the hashes.
> * Add comment about lookups having to be done in an RCU read-critical
> section.
> * remove map->stale; simply check ht->map before and after acquiring
> a bucket lock.
> * only use atomic_read/set on bucket pointers, not hashes. Reading
> partially-updated hashes is OK, since we'll retry anyway thanks
> to the seqlock. Add a comment regarding this at the top of struct
> qht_bucket.
> * s/b->n/b->n_buckets/
> * define qht_debug_assert, enabled #ifdef QHT_DEBUG. Use it instead of
> assert(), except in one case (slow path) where g_assert_cmpuint is
> convenient.
> * use a mutex for ht->lock instead of a spinlock. This makes the resize
> code simpler, since holding ht->lock for a bit of time is OK now;
> other threads won't be busy-waiting. Document that ht->lock needs
> to be grabbed before b->lock.
> * use atomic_rcu_read/set instead of open-coding them.
> * qht_remove: only clear out b->hashes[] and b->pointers[] if they belong
> to what was the last entry in the chain.
> * qht_remove: add debug assert against inserting a NULL pointer.
>
> Thanks,
>
> Emilio
--
Alex Bennée
next prev parent reply other threads:[~2016-06-08 6:25 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-25 1:13 [Qemu-devel] [PATCH v6 00/15] tb hash improvements Emilio G. Cota
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 01/15] compiler.h: add QEMU_ALIGNED() to enforce struct alignment Emilio G. Cota
2016-05-27 19:54 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 02/15] seqlock: remove optional mutex Emilio G. Cota
2016-05-27 19:55 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 03/15] seqlock: rename write_lock/unlock to write_begin/end Emilio G. Cota
2016-05-27 19:59 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 04/15] include/processor.h: define cpu_relax() Emilio G. Cota
2016-05-27 20:53 ` Sergey Fedorov
2016-05-27 21:10 ` Emilio G. Cota
2016-05-28 12:35 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 05/15] qemu-thread: add simple test-and-set spinlock Emilio G. Cota
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 06/15] exec: add tb_hash_func5, derived from xxhash Emilio G. Cota
2016-05-28 12:36 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 07/15] tb hash: hash phys_pc, pc, and flags with xxhash Emilio G. Cota
2016-05-28 12:39 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 08/15] qdist: add module to represent frequency distributions of data Emilio G. Cota
2016-05-28 18:15 ` Sergey Fedorov
2016-06-03 17:22 ` Emilio G. Cota
2016-06-03 17:29 ` Sergey Fedorov
2016-06-03 17:46 ` Sergey Fedorov
2016-06-06 23:40 ` Emilio G. Cota
2016-06-07 14:06 ` Sergey Fedorov
2016-06-07 22:53 ` Emilio G. Cota
2016-06-08 13:09 ` Sergey Fedorov
2016-06-07 1:05 ` Emilio G. Cota
2016-06-07 15:56 ` Sergey Fedorov
2016-06-08 0:02 ` Emilio G. Cota
2016-06-08 14:10 ` Sergey Fedorov
2016-06-08 18:06 ` Emilio G. Cota
2016-06-08 18:18 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 09/15] qdist: add test program Emilio G. Cota
2016-05-28 18:56 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 10/15] qht: QEMU's fast, resizable and scalable Hash Table Emilio G. Cota
2016-05-29 19:52 ` Sergey Fedorov
2016-05-29 19:55 ` Sergey Fedorov
2016-05-31 7:46 ` Alex Bennée
2016-06-01 20:53 ` Sergey Fedorov
2016-06-03 9:18 ` Emilio G. Cota
2016-06-03 15:19 ` Sergey Fedorov
2016-06-03 11:01 ` Emilio G. Cota
2016-06-03 15:34 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 11/15] qht: add test program Emilio G. Cota
2016-05-29 20:15 ` Sergey Fedorov
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 12/15] qht: add qht-bench, a performance benchmark Emilio G. Cota
2016-05-29 20:45 ` Sergey Fedorov
2016-06-03 11:41 ` Emilio G. Cota
2016-06-03 15:41 ` Sergey Fedorov
2016-05-31 15:12 ` Alex Bennée
2016-05-31 16:44 ` Emilio G. Cota
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 13/15] qht: add test-qht-par to invoke qht-bench from 'check' target Emilio G. Cota
2016-05-29 20:53 ` Sergey Fedorov
2016-06-03 11:07 ` Emilio G. Cota
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 14/15] tb hash: track translated blocks with qht Emilio G. Cota
2016-05-29 21:09 ` Sergey Fedorov
2016-05-31 8:39 ` Alex Bennée
2016-05-25 1:13 ` [Qemu-devel] [PATCH v6 15/15] translate-all: add tb hash bucket info to 'info jit' dump Emilio G. Cota
2016-05-29 21:14 ` Sergey Fedorov
2016-06-08 6:25 ` Alex Bennée [this message]
2016-06-08 15:16 ` [Qemu-devel] [PATCH v6 00/15] tb hash improvements Emilio G. Cota
2016-06-08 15:35 ` Richard Henderson
2016-06-08 15:37 ` Sergey Fedorov
2016-06-08 16:45 ` Alex Bennée
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=87inxkgpsy.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=cota@braap.org \
--cc=mttcg@listserver.greensocs.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=serge.fdrv@gmail.com \
/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).