[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue |
Date: |
Tue, 27 Nov 2018 14:51:15 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
On 27/11/18 13:49, Christophe de Dinechin wrote:
> So this is not really
> helping. Also, the ThreadLocal structure itself is not necessarily aligned
> within struct Threads. Therefore, it’s possible that “requests” for example
> could be on the same cache line as request_fill_bitmap if planets align
> the wrong way.
I think this is a bit exaggerated. Linux and QEMU's own qht work just
fine with compile-time directives.
> In order to mitigate these effects, I would group the data that the user
> writes and the data that the thread writes, i.e. reorder declarations,
> put request_fill_bitmap and request_valid_ev together, and try
> to put them in the same cache line so that only one cache line is invalidated
> from within mark_request_valid instead of two.
>
> Then you end up with a single alignment directive instead of 4, to
> separate requests from completions.
Yeah, I agree with this.
> That being said, I’m not sure why you use a bitmap here. What is the
> expected benefit relative to atomic lists (which would also make it really
> lock-free)?
>
I don't think lock-free lists are easier. Bitmaps smaller than 64
elements are both faster and easier to manage.
Paolo
- Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue, (continued)
Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue, Emilio G. Cota, 2018/11/23
Re: [Qemu-devel] [PATCH v3 2/5] util: introduce threaded workqueue, Christophe de Dinechin, 2018/11/27
[Qemu-devel] [PATCH v3 3/5] migration: use threaded workqueue for compression, guangrong . xiao, 2018/11/22
[Qemu-devel] [PATCH v3 5/5] tests: add threaded-workqueue-bench, guangrong . xiao, 2018/11/22
[Qemu-devel] [PATCH v3 4/5] migration: use threaded workqueue for decompression, guangrong . xiao, 2018/11/22
Re: [Qemu-devel] [PATCH v3 0/5] migration: improve multithreads, no-reply, 2018/11/22