From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIj6v-0000ro-82 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIj6r-0000Vt-0g for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:17:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIj6q-0000Vi-Oz for qemu-devel@nongnu.org; Thu, 21 Mar 2013 13:17:00 -0400 Date: Thu, 21 Mar 2013 19:15:25 +0200 From: "Michael S. Tsirkin" Message-ID: <20130321171525.GE2994@redhat.com> References: <20130321061838.GA28319@redhat.com> <20130321070357.GD28328@redhat.com> <20130321085107.GE28328@redhat.com> <20130321093946.GG28328@redhat.com> <20130321171115.GA653@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130321171115.GA653@obsidianresearch.com> Subject: Re: [Qemu-devel] [PATCH] rdma: don't make pages writeable if not requiested List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Gunthorpe Cc: Roland Dreier , qemu-devel@nongnu.org, "linux-rdma@vger.kernel.org" , Yishai Hadas , LKML , "Michael R. Hines" , Hal Rosenstock , Sean Hefty , Christoph Lameter On Thu, Mar 21, 2013 at 11:11:15AM -0600, Jason Gunthorpe wrote: > On Thu, Mar 21, 2013 at 11:39:47AM +0200, Michael S. Tsirkin wrote: > > On Thu, Mar 21, 2013 at 02:13:38AM -0700, Roland Dreier wrote: > > > On Thu, Mar 21, 2013 at 1:51 AM, Michael S. Tsirkin wrote: > > > >> In that case, no, I don't see any reason for LOCAL_WRITE, since the > > > >> only RDMA operations that will access this memory are remote reads. > > > > > > > > What is the meaning of LOCAL_WRITE then? There are no local > > > > RDMA writes as far as I can see. > > > > > > Umm, it means you're giving the local adapter permission to write to > > > that memory. So you can use it as a receive buffer or as the target > > > for remote data from an RDMA read operation. > > > > Well RDMA read has it's own flag, IB_ACCESS_REMOTE_READ. > > I don't see why do you need to give adapter permission > > The access flags have to do with what independent access remote nodes > get. There are four major cases: > > access = IBV_ACCESS_REMOTE_READ says the adaptor will let remote nodes > read the memory. > > access = 0 (ie IBV_ACCESS_LOCAL_READ) says that only the adaptor, under > the direct control of the application, can read this memory. Remote > nodes are barred. > > access = IBV_ACCESS_REMOTE_WRITE|IBV_ACCESS_LOCAL_WRITE says the adaptor > will let remote nodes write the memory > > access = IBV_ACCESS_LOCAL_WRITE bars remote nodes from writing to that > memory. Only the adaptor, under the direct control of the application, > can write the memory. > > The fact LOCAL_READ/REMOTE_READ exists makes it possible to do what > you want - it guarentees the adaptor will never write to this memory > under any circumstances, so you can leave the page COW'd. If > LOCAL_WRITE was implied then you'd have to COW everything.. > > Would it be better to drive the COW break decision off the region's MM > flags? Ie if the memory is mapped read only into the process then you > can keep the COW at the RDMA layer, otherwise you should break > it. That seems more natural than a new flag? > > Jason No because application does this: init page ... after a lot of time .. register send unregister so it can not be read only. -- MST