Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754401AbdCHUMe (ORCPT ); Wed, 8 Mar 2017 15:12:34 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:38390 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754206AbdCHUMa (ORCPT ); Wed, 8 Mar 2017 15:12:30 -0500 Date: Wed, 8 Mar 2017 15:11:57 -0500 From: Konrad Rzeszutek Wilk To: Stefano Stabellini Cc: jgross@suse.com, Latchesar Ionkov , Eric Van Hensbergen , linux-kernel@vger.kernel.org, Stefano Stabellini , v9fs-developer@lists.sourceforge.net, Ron Minnich , xen-devel@lists.xenproject.org, Boris Ostrovsky Subject: Re: [Xen-devel] [PATCH 6/7] xen/9pfs: receive responses Message-ID: <20170308201157.GA9643@char.us.oracle.com> References: <1488830488-18506-1-git-send-email-sstabellini@kernel.org> <1488830488-18506-6-git-send-email-sstabellini@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1098 Lines: 32 On Tue, Mar 07, 2017 at 05:13:59PM -0800, Stefano Stabellini wrote: > On Tue, 7 Mar 2017, Stefano Stabellini wrote: > > > > + > > > > + ring = container_of(work, struct xen_9pfs_dataring, work); > > > > + priv = ring->priv; > > > > + > > > > + while (1) { > > > > + cons = ring->intf->in_cons; > > > > + prod = ring->intf->in_prod; > > > > + rmb(); > > > > > > > > > Is this rmb() or mb()? (Or, in fact, virt_XXX()?) You used mb() in the > > > previous patch. > > > > I think they should all be virt_XXX, thanks. > > regarding mb() vs. rmb(), give a look at the workflow at the end of > docs/misc/9pfs.markdown, under "Ring Usage". That is not what Boris meant. He meant that you should use the virt_ variants instead of the rmb() or wmb(). The reason that on UP kernels the rmb() and wmb() can be converted to NOPs. While that is OK for a UP kernel it is not good in virtualization as we need those barriers regardless of the flavor of the kernel. > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > https://lists.xen.org/xen-devel