Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934154AbbEOLAu (ORCPT ); Fri, 15 May 2015 07:00:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50534 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752562AbbEOLAq (ORCPT ); Fri, 15 May 2015 07:00:46 -0400 Date: Fri, 15 May 2015 12:00:41 +0100 From: Mel Gorman To: Daniel Phillips Cc: Rik van Riel , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, tux3@tux3.org, OGAWA Hirofumi , Andrea Arcangeli , Peter Zijlstra Subject: Re: [FYI] tux3: Core changes Message-ID: <20150515110041.GV2462@suse.de> References: <8f886f13-6550-4322-95be-93244ae61045@phunq.net> <55545C2F.8040207@phunq.net> <55549C2F.6000103@redhat.com> <5555388F.5010909@phunq.net> <555562AE.9020204@redhat.com> <20150515080902.GU2462@suse.de> <5555C268.4000304@phunq.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <5555C268.4000304@phunq.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2902 Lines: 71 On Fri, May 15, 2015 at 02:54:48AM -0700, Daniel Phillips wrote: > > > On 05/15/2015 01:09 AM, Mel Gorman wrote: > > On Thu, May 14, 2015 at 11:06:22PM -0400, Rik van Riel wrote: > >> On 05/14/2015 08:06 PM, Daniel Phillips wrote: > >>>> The issue is that things like ptrace, AIO, infiniband > >>>> RDMA, and other direct memory access subsystems can take > >>>> a reference to page A, which Tux3 clones into a new page B > >>>> when the process writes it. > >>>> > >>>> However, while the process now points at page B, ptrace, > >>>> AIO, infiniband, etc will still be pointing at page A. > >>>> > >>>> This causes the process and the other subsystem to each > >>>> look at a different page, instead of at shared state, > >>>> causing ptrace to do nothing, AIO and RDMA data to be > >>>> invisible (or corrupted), etc... > >>> > >>> Is this a bit like page migration? > >> > >> Yes. Page migration will fail if there is an "extra" > >> reference to the page that is not accounted for by > >> the migration code. > > > > When I said it's not like page migration, I was referring to the fact > > that a COW on a pinned page for RDMA is a different problem to page > > migration. The COW of a pinned page can lead to lost writes or > > corruption depending on the ordering of events. > > I see the lost writes case, but not the corruption case, Data corruption can occur depending on the ordering of events and the applications expectations. If a process starts IO, RDMA pins the page for read and forks are combined with writes from another thread then when the IO completes the reads may not be visible. The application may take improper action at that point. Users of RDMA are typically expected to use MADV_DONTFORK to avoid this class of problem. You can choose to not define this as data corruption because thge kernel is not directly involved and that's your call. > Do you > mean corruption by changing a page already in writeout? If so, > don't all filesystems have that problem? > No, the problem is different. Backing devices requiring stable pages will block the write until the IO is complete. For those that do not require stable pages it's ok to allow the write as long as the page is dirtied so that it'll be written out again and no data is lost. > If RDMA to a mmapped file races with write(2) to the same file, > maybe it is reasonable and expected to lose some data. > In the RDMA case, there is at least application awareness to work around the problems. Normally it's ok to have both mapped and write() access to data although userspace might need a lock to co-ordinate updates and event ordering. -- Mel Gorman SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/