Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp4021365imj; Tue, 12 Feb 2019 08:29:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IaOEnaU5fz3gIroTDgNxkx2SDUzkO3OrPOvkjaqWyoUz4CQyvLUfje/Gxhrh1mP9AX93Z+k X-Received: by 2002:a63:295:: with SMTP id 143mr4228134pgc.362.1549988960377; Tue, 12 Feb 2019 08:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549988960; cv=none; d=google.com; s=arc-20160816; b=csYQrcAV7VcvXL9EzET9OX8x+scM72hufH8Zc/ArgIgEtMkiokddCnu6JqXNOONUWD YNUWOnQeTLgb1aiBcnpGQR0y51xqXOoAK4AnCidIIwt/nvzssX3ZuC1q6DTjQ3IT2K9I Rw0UFnvtl2zksi4IeLXqOT7Ox9dV9hZkJsKZTT4lV95mn+1VDrDtx5KU5qR/wHk8oJMC JoQNDOW1bIGmDIxQey7vIZcrhhannKPDbbmAllOBzhwJV31UxV+US627VRXmw/HMcxEs +5uiZbH5ZRABrHT0Ngm5gnt1Tw9MNH6aKR8UGSNrzGSUdoU6HTdMLhfV9wRhX/p5t17o eQOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ukxr7fjPorI1dRNVvJhpr/xC2RQ+hd6fk1EhheYEpDw=; b=jJGIyzc5K95YTW8GOXafn8sEePqupKT0DjdONPyWXBJO7A+hnAVpiNtz1kb8aBiWTO zb8Nsv1tPoJmxUcp9MhRrdIJoCMCeNLF0NGNtBRvu1sg2DhwKHgs6bk91fqS03nRU12Z oH2EaJvw35ZsV4HuXimevvxkMcQkaTfe4OqJsRRj68oIoDF30MKnv6WltuJuITgoO+gY QkyiPveOG2OP7/w7cBvZtHf0ANjkPsRNfHmGhtr5dflkQenoCSeyD7sCGZCS9B55ZEUD 8PCPbqMsAgGM9G42xGcFpw69CrpOFo6xQiHs633nrOuEIBjRlZOUiVGZwP+5vzN6a/zH 83tQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si546585plt.295.2019.02.12.08.29.03; Tue, 12 Feb 2019 08:29:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729398AbfBLQ2f (ORCPT + 99 others); Tue, 12 Feb 2019 11:28:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:37936 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727442AbfBLQ2e (ORCPT ); Tue, 12 Feb 2019 11:28:34 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 38887B60F; Tue, 12 Feb 2019 16:28:33 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 904741E09C5; Tue, 12 Feb 2019 17:28:32 +0100 (CET) Date: Tue, 12 Feb 2019 17:28:32 +0100 From: Jan Kara To: Jason Gunthorpe Cc: Dan Williams , Jan Kara , Dave Chinner , Christopher Lameter , Doug Ledford , Matthew Wilcox , Ira Weiny , lsf-pc@lists.linux-foundation.org, linux-rdma , Linux MM , Linux Kernel Mailing List , John Hubbard , Jerome Glisse , Michal Hocko Subject: Re: [LSF/MM TOPIC] Discuss least bad options for resolving longterm-GUP usage by RDMA Message-ID: <20190212162832.GC19076@quack2.suse.cz> References: <0c868bc615a60c44d618fb0183fcbe0c418c7c83.camel@redhat.com> <01000168c8e2de6b-9ab820ed-38ad-469c-b210-60fcff8ea81c-000000@email.amazonses.com> <20190208044302.GA20493@dastard> <20190208111028.GD6353@quack2.suse.cz> <20190211102402.GF19029@quack2.suse.cz> <20190211180654.GB24692@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211180654.GB24692@ziepe.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 11-02-19 11:06:54, Jason Gunthorpe wrote: > On Mon, Feb 11, 2019 at 09:22:58AM -0800, Dan Williams wrote: > > > I honestly don't like the idea that random subsystems can pin down > > file blocks as a side effect of gup on the result of mmap. Recall that > > it's not just RDMA that wants this guarantee. It seems safer to have > > the file be in an explicit block-allocation-immutable-mode so that the > > fallocate man page can describe this error case. Otherwise how would > > you describe the scenarios under which FALLOC_FL_PUNCH_HOLE fails? > > I rather liked CL's version of this - ftruncate/etc is simply racing > with a parallel pwrite - and it doesn't fail. The problem is page pins are not really like pwrite(). They are more like mmap access. And that will just SIGBUS after truncate. So from user point of view I agree the result may not be that surprising (it would seem just as if somebody did additional pwrite) but from filesystem point of view it is very different and it would mean a special handling in lots of places. So I think that locking down the file before allowing gup_longterm() looks like a more viable alternative. Honza -- Jan Kara SUSE Labs, CR