From: Wei Liu Subject: Re: [Minios-devel] [PATCH MINI-OS] xenbus: notify the other end when necessary Date: Mon, 26 Oct 2015 12:36:42 +0000 Message-ID: <20151026123642.GF13118@zion.uk.xensource.com> References: <1445852868-16532-1-git-send-email-wei.liu2@citrix.com> <20151026120245.GA19459@var.bordeaux.inria.fr> <20151026121442.GD13118@zion.uk.xensource.com> <20151026122151.GC19459@var.bordeaux.inria.fr> <20151026123028.GE13118@zion.uk.xensource.com> <20151026123312.GJ19459@var.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline In-Reply-To: <20151026123312.GJ19459@var.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Samuel Thibault , Wei Liu , minios-devel@lists.xenproject.org, Xen-devel , Ian Campbell , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Mon, Oct 26, 2015 at 01:33:12PM +0100, Samuel Thibault wrote: > Wei Liu, le Mon 26 Oct 2015 12:30:28 +0000, a =E9crit : > > On Mon, Oct 26, 2015 at 01:21:51PM +0100, Samuel Thibault wrote: > > > Wei Liu, le Mon 26 Oct 2015 12:14:43 +0000, a =E9crit : > > > > In my patch, mini-os notifies remote whenever it consumes a message, > > > > which I think it's slightly better because backend can start putting > > > > things in the ring as mini-os processes them. > > > = > > > That makes more notifications, but that can lead to more pipelining > > > indeed. That's what the Linux driver does, so let's do the same. > > > = > > > Also, I'm realizing: aren't we missing a full memory barrier between > > > the memcpy_from_ring call and xenstore_buf->rsp_cons +=3D ? (in the t= wo > > > places) We need to make sure to have finished copying from the ring > > > before writing the new rsp_cons. > > > = > > = > > You're right. > > = > > I think we should just turn that wmb() into two mb()s and place them > > before xenstore_buf->rsp_cons +=3D. > = > We *also* need some barrier between rsp_cons +=3D and the notification, > otherwise the notified domain may miss the rsp_cons update and thus > believe it was a spurious notification. > = Actually notify_remote_via_evtchn normally implies a mb(). But I think I'd stay on the safe side. I will have a wmb() there. :-) Thanks for your review. V2 coming soon. Wei. > Samuel > = > _______________________________________________ > Minios-devel mailing list > Minios-devel@lists.xenproject.org > http://lists.xenproject.org/cgi-bin/mailman/listinfo/minios-devel