[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] global_mutex and multithread.
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] global_mutex and multithread. |
Date: |
Thu, 15 Jan 2015 12:26:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 15/01/2015 12:14, Alexander Graf wrote:
>> >
>> > Once you have >1 VCPU thread you'll need the RCU work that I am slowly
>> > polishing and sending out. That's because one device can change the
>> > memory map, and that will cause a tlb_flush for all CPUs in tcg_commit,
>> > and that's not thread-safe.
> You'll have a similar problem for tb_flush() if you use a single tb
> cache. Just introduce a big hammer function for now that IPIs all the
> other threads, waits until they halted, do the atomic instruction (like
> change the memory map or flush the tb cache), then let them continue.
For the memory map I played with just using cpu_interrupt instead of
waiting for the halt of the other CPUs. That's safe for 1 VCPU thread,
but not for >1 thread. Perhaps we can exit the other CPUs with a signal
and cpu_resume_from_signal.
Paolo
Re: [Qemu-devel] global_mutex and multithread., Mark Burton, 2015/01/15