On Mon, Aug 05, 2019 at 12:20:45PM +0800, Jason Wang wrote:
On 2019/8/2 äå8:46, Jason Gunthorpe wrote:If things are already running in a work, then yes, you can piggyback
On Fri, Aug 02, 2019 at 05:40:07PM +0800, Jason Wang wrote:
I've also idly wondered if calling synchronize_rcu() under the variousThis must be a proper barrier, like a spinlock, mutex, orI start with synchronize_rcu() but both you and Michael raise some
synchronize_rcu.
concern.
mm locks is a deadlock situation.
Maybe, that's why I suggest to use vhost_work_flush() which is much
lightweight can can achieve the same function. It can guarantee all previous
work has been processed after vhost_work_flush() return.
on the existing spinlocks inside the workqueue and be Ok
However, if that work is doing any copy_from_user, then the flush
becomes dependent on swap and it won't work again...
1) spinlock: add lots of overhead on datapath, this leads 0 performanceI think the topic here is correctness not performance improvement>
improvement.
But the whole series is to speed up vhost.So? Starting with a whole bunch of crazy, possibly broken, locking and
claiming a performance win is not reasonable.
Spinlock is correct but make the whole series meaningless consider it won'tYou can't invent a faster spinlock by opencoding some wild
bring any performance improvement.
scheme. There is nothing special about the usage here, it needs a
blocking lock, plain and simple.
Jason