qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Konrad <fred.konrad@greensocs.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	Mark Burton <mark.burton@greensocs.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: mttcg@listserver.greensocs.com,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] global_mutex and multithread.
Date: Fri, 16 Jan 2015 09:43:44 +0100	[thread overview]
Message-ID: <54B8CF40.8040602@greensocs.com> (raw)
In-Reply-To: <54B8C6CA.5080201@siemens.com>

On 16/01/2015 09:07, Jan Kiszka wrote:
> On 2015-01-16 08:25, Mark Burton wrote:
>>> On 15 Jan 2015, at 22:41, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>>
>>>
>>>
>>> On 15/01/2015 21:53, Mark Burton wrote:
>>>>> Jan said he had it working at least on ARM (MusicPal).
>>>> yeah - our problem is when we enable multi-threads - which I dont believe Jan did…
>>> Multithreaded TCG, or single-threaded TCG with SMP?
>> He mentions SMP, - I assume thats single-threaded ….
> Yes, I didn't patched anything towards multi-threaded SMP. Main reason:
> there was no answer on how to emulated the memory models of that target
> architecture over the host one which is mandatory if you let the
> emulated CPUs run unsynchronized in parallel. Did this change?
Hi Jan,

Actually it's what we are trying to do, running emulated CPUs in parallel.

I get a double mutex_lock error (eg: no unlock) I must have missed something
during the "rebase".
I'll check.

Thanks,
Fred

>>>>>> One thing I wonder - why do we need to go to the extent of mutexing
>>>>>> in the TCG like this? Why can’t you simply put a mutex get/release on
>>>>>> the slow path? If the core is going to do ‘fast path’ access to the
>>>>>> memory, - even if that memory was IO mapped - would it matter if it
>>>>>> didn’t have the mutex?
>>>>> Because there is no guarantee that the memory map isn't changed by a
>>>>> core under the feet of another.  The TLB (in particular the "iotlb") is
>>>>> only valid with reference to a particular memory map.
>>>>> Changes to the memory map certainly happen in the slow path, but lookups
>>>>> are part of the fast path.  Even an rwlocks is too slow for a fast path,
>>>>> hence the plan of going with RCU.
>>>> Could we arrange the world such that lookups ‘succeed’ (the wheels
>>>> dont fall off) -ether getting the old value, or the new, but not getting
>>>> rubbish - and we still only take the mutex if we are going to make
>>>> alterations to the MM itself? (I have’t looked at the code around that…
>>>> so sorry if the question is ridiculous).
>>> That's the definition of RCU. :)  Look at the docs in
>>> http://permalink.gmane.org/gmane.comp.emulators.qemu/313929 for more
>>> information. :)
>> Ahh - I see !
>>
>>> It's still not trivial to make it 100% correct, but at the same time
>>> it's not too hard to prepare something decent to play with.  Also, most
>>> of the work can be done with KVM so it's more or less independent from
>>> what you guys have been doing so far.
>> Yes - the issue is if we end up relying on it.
>> But - I see what you mean - these 2 things can ‘dovetail’ together “independently” - so - Jan’s patch will be good for now, and then later we can use RCU to make it work more generally (and more efficiently).
>>
>> So - our only small problem is getting Jan’s patch to work for multi-thread :-))
> See above regarding the potential dimension.
>
> Jan
>

  reply	other threads:[~2015-01-16  8:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15 10:25 [Qemu-devel] global_mutex and multithread Frederic Konrad
2015-01-15 10:34 ` Peter Maydell
2015-01-15 10:41   ` Frederic Konrad
2015-01-15 10:44 ` Paolo Bonzini
2015-01-15 11:12 ` Paolo Bonzini
2015-01-15 11:14   ` Alexander Graf
2015-01-15 11:26     ` Paolo Bonzini
2015-01-15 13:30     ` Frederic Konrad
2015-01-15 13:34       ` Mark Burton
2015-01-15 12:51   ` Frederic Konrad
2015-01-15 12:56     ` Paolo Bonzini
2015-01-15 13:27       ` Frederic Konrad
2015-01-15 13:30         ` Peter Maydell
2015-01-15 19:07   ` Mark Burton
2015-01-15 20:27     ` Paolo Bonzini
2015-01-15 20:53       ` Mark Burton
2015-01-15 21:41         ` Paolo Bonzini
2015-01-15 21:41         ` Paolo Bonzini
2015-01-16  7:25           ` Mark Burton
2015-01-16  8:07             ` Jan Kiszka
2015-01-16  8:43               ` Frederic Konrad [this message]
2015-01-16  8:52               ` Mark Burton

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=54B8CF40.8040602@greensocs.com \
    --to=fred.konrad@greensocs.com \
    --cc=agraf@suse.de \
    --cc=jan.kiszka@siemens.com \
    --cc=mark.burton@greensocs.com \
    --cc=mttcg@listserver.greensocs.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).