From: Ian Campbell Subject: Re: [PATCH 6/7] mini-os: Added rmb to xenbus code Date: Fri, 6 Jun 2014 15:15:42 +0100 Message-ID: <1402064142.1313.62.camel@kazak.uk.xensource.com> References: <538D9161.6090402@linaro.org> <1401897998-29569-1-git-send-email-talex5@gmail.com> <1401897998-29569-7-git-send-email-talex5@gmail.com> <539076E9.4020007@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wsuvr-0007Pt-GL for xen-devel@lists.xenproject.org; Fri, 06 Jun 2014 14:15:47 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "karim.allah.ahmed@gmail.com" Cc: xen-devel@lists.xenproject.org, Thomas Leonard , Julien Grall , Samuel Thibault List-Id: xen-devel@lists.xenproject.org On Fri, 2014-06-06 at 05:59 +0100, karim.allah.ahmed@gmail.com wrote: > In any case, by looking at the patch it seems like rmb was required to > make sure that the reply message is visible to the current processor > when this thread wakes up and starts reading it. Can we assume (or arrange) that schedule() gives us this guarantee? Do we want to? I don't think the current schedule() common code guarantees this, and obviously the x86 arch code doesn't care. Someone should decide... > > I'll have a look at the other patches and put some comments there as well. > > Regards. > > On Thu, Jun 5, 2014 at 6:45 PM, Thomas Leonard wrote: > > Hi Karim, > > > > Do you remember what this rmb call is for? It's from your commit here: > > > > https://github.com/KarimAllah/xen/commit/61e8edeb9eabdf575f6f8e7720d977f07d907579#diff-dd67cee31c935093d2c65298a1d5b267R455 > > > > https://github.com/KarimAllah/xen/blob/61e8edeb9eabdf575f6f8e7720d977f07d907579/extras/mini-os/xenbus/xenbus.c#L455 > > > > Also, if you have any information to add to the other commits, that > > would be very useful: > > > > https://github.com/talex5/xen/commits/sent-Jun-04 > > > > > > > > On 5 June 2014 14:55, Julien Grall wrote: > >> Hi Thomas, > >> > >> Thank you for the patch. > >> > >> On 06/04/2014 05:06 PM, Thomas Leonard wrote: > >>> From: Karim Raslan > >>> > >>> Signed-off-by: Karim Allah Ahmed > >>> [talex5@gmail.com: separated from big ARM commit] > >>> Signed-off-by: Thomas Leonard > >>> --- > >>> extras/mini-os/xenbus/xenbus.c | 1 + > >>> 1 file changed, 1 insertion(+) > >>> > >>> diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c > >>> index d995020..8a99ee2 100644 > >>> --- a/extras/mini-os/xenbus/xenbus.c > >>> +++ b/extras/mini-os/xenbus/xenbus.c > >>> @@ -450,6 +450,7 @@ xenbus_msg_reply(int type, > >>> remove_waiter(w, req_info[id].waitq); > >>> wake(current); > >>> > >>> + rmb(); > >> > >> Could you explain in the commit message why this rmb is necessary? > >> > >> Regards, > >> > >> -- > >> Julien Grall > > > > > > > > -- > > Dr Thomas Leonard http://0install.net/ > > GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1 > > GPG: DA98 25AE CAD0 8975 7CDA BD8E 0713 3F96 CA74 D8BA > > >