All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Mark Burton <mark.burton@greensocs.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: mttcg@listserver.greensocs.com, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Help on TLB Flush
Date: Thu, 12 Feb 2015 16:19:48 +0100	[thread overview]
Message-ID: <54DCC494.2010400@suse.de> (raw)
In-Reply-To: <45883806-2296-486F-A0DC-D8A0A74F85B9@greensocs.com>



On 12.02.15 16:08, Mark Burton wrote:
> 
>> On 12 Feb 2015, at 16:01, Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On 12 February 2015 at 14:45, Alexander Graf <agraf@suse.de> wrote:
>>>
>>>> On 12.02.2015, at 15:35, Mark Burton <mark.burton@greensocs.com> wrote:
>>>> We are proposing to implement this by signalling all other CPU’s
>>>> to exit (and requesting they flush before re-starting). In other
>>>> words, this would happen asynchronously.
>>>
>>> For global flushes, give them a pointer payload along with the flush
>>> request and tell all cpus to increment it atomically. In your main
>>> thread, wait until *ptr == nKickedCpus.
>>
>> I bet this will not be the only situation where you want to
>> do an "get all other CPUs to do $something and wait til they
>> have done so" kind of operation, so some lightweight but generic
>> infrastructure for doing that would not be a bad plan. (Similarly
>> "get all other CPUs to stop, then I can do $something and let
>> the others continue”.)
> 
> We tried this - we ended up in knots.
> We had 2 CPU’s trying to flush at about the same time, both waiting for the other.
> We had CPU’s trying to get the global mutex to finish what they were doing, while being told to flush, 
> We had CPU’s in the global mutex trying to do something that would cause a flush… etc....
> We had spaghetti with extra Bolognese sauce…
> 
> We eventually concluded, yes - in an infinite universe everything is possible, but if we could simply do this ‘asynchronously’ then our lives would be a LOT easier.
> e.g.  - ask all CPU’s to “exit and do something” is easy -  wait for them to do that is a whole other problem…
> 
> Our question is - do we need this ‘sync’ (before the flush), or can we actually allow CPU’s to flush themselves asynchronously….

The respective target architecture specs will tell you. And I very much
doubt that it is ok in most cases.


Alex

  reply	other threads:[~2015-02-12 15:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 14:35 [Qemu-devel] Help on TLB Flush Mark Burton
2015-02-12 14:45 ` Alexander Graf
2015-02-12 14:58   ` Peter Maydell
2015-02-12 15:38     ` Alexander Graf
2015-02-12 16:02       ` Mark Burton
2015-02-12 22:10         ` Lluís Vilanova
2015-02-13  7:16           ` Mark Burton
2015-02-13  7:24             ` Peter Maydell
2015-02-13  7:37               ` Mark Burton
2015-02-13 13:30                 ` Lluís Vilanova
2015-02-13 13:32                   ` Mark Burton
2015-02-12 22:02       ` Peter Maydell
2015-02-12 15:01   ` Peter Maydell
2015-02-12 15:08     ` Mark Burton
2015-02-12 15:19       ` Alexander Graf [this message]
2015-02-12 21:57         ` Peter Maydell
2015-02-13  9:34           ` Paolo Bonzini
2015-02-13  9:37             ` Mark Burton
2015-02-13  9:49               ` Paolo Bonzini
2015-02-12 15:31       ` Dr. David Alan Gilbert
2015-02-12 18:44         ` Mark Burton
2015-02-12 15:11   ` 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=54DCC494.2010400@suse.de \
    --to=agraf@suse.de \
    --cc=mark.burton@greensocs.com \
    --cc=mttcg@listserver.greensocs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.