qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 09/12] ring: introduce lockless ring buffer


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [PATCH 09/12] ring: introduce lockless ring buffer
Date: Fri, 29 Jun 2018 15:47:46 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



On 06/29/2018 02:15 PM, Jason Wang wrote:


On 2018年06月29日 11:59, Xiao Guangrong wrote:


On 06/28/2018 09:36 PM, Jason Wang wrote:


On 2018年06月04日 17:55, address@hidden wrote:
From: Xiao Guangrong<address@hidden>

It's the simple lockless ring buffer implement which supports both
single producer vs. single consumer and multiple producers vs.
single consumer.


Finally, it fetches the valid data out, set the entry to the initialized
state and update ring->out to make the entry be usable to the producer:

       data = *entry;
       *entry = NULL;
       ring->out++;

Memory barrier is omitted here, please refer to the comment in the code.

(1)https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/kfifo.h
(2)http://dpdk.org/doc/api/rte__ring_8h.html

Signed-off-by: Xiao Guangrong<address@hidden>
---

May I ask why you need a MPSC ring here? Can we just use N SPSC ring for 
submitting pages and another N SPSC ring for passing back results?

Sure.

We had this option in our mind, however, it is not scalable which will slow
the main thread down, instead, we'd rather to speed up main thread and move
reasonable workload to the threads.

I'm not quite understand the scalability issue here. Is it because of main 
thread need go through all N rings (which I think not)?

Yes, it is.

The main thread need to check each single thread and wait
it done one by one...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]