From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EA3FC17448 for ; Tue, 12 Nov 2019 22:46:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 634E1222C2 for ; Tue, 12 Nov 2019 22:46:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="g+shynx9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 634E1222C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0D2036B0005; Tue, 12 Nov 2019 17:46:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 081976B0006; Tue, 12 Nov 2019 17:46:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED9B26B0007; Tue, 12 Nov 2019 17:46:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0045.hostedemail.com [216.40.44.45]) by kanga.kvack.org (Postfix) with ESMTP id DA4FB6B0005 for ; Tue, 12 Nov 2019 17:46:03 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 85E7E180AD82F for ; Tue, 12 Nov 2019 22:46:03 +0000 (UTC) X-FDA: 76149109806.20.brass52_6f03839f1a055 X-HE-Tag: brass52_6f03839f1a055 X-Filterd-Recvd-Size: 5349 Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 12 Nov 2019 22:46:02 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id s71so16431241oih.11 for ; Tue, 12 Nov 2019 14:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7VZux41I9l8WsaFw4dnSKoQ+DL1POYbdTwXxPgsqOD8=; b=g+shynx9wA4O7/ZPSOmOhvhdFUBcChFyBb7EYzal20VNZRr14tSC8CEEu8RhYVOSKP ujUV0PqIhIH36zKviPook+HnkIHuRG88nmkcJhEvO3dJXo36vkvTp3d/Rv5+wpQSmOnU bQU0r/Fslk/8pH+0JUylPowC6D4ZnT5PrmHiZ30JXUbKpZ1rMZQ7kmT50jl8KfJoHp7m VvEK+ooBIm3vYED6+FUL9oFvr5SRhfXOEafMoAbLZrqHGNUi1aW7WiDjR5Rr2M+YKo5Q 1bTGao6fq7ZjCHqOdYHjYnxFv2rb5XbPoQBWE0A1WALsbQq7HL4C3F5HipXsfgbDt8Vf nWjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7VZux41I9l8WsaFw4dnSKoQ+DL1POYbdTwXxPgsqOD8=; b=qoF69IDnQiWE677+RRthqV8FSYD2uZa7OvfqlWVEt3gVcUKs9JzJCPx63BgQsUglf3 TK2EkV/JxqePC1/7Az2us12uYr+4gMn82fUyPp++S3jNyezUPhCHj2uUFcOKCvNbE+yi NKUUG2tiQ3KEslfE7HMMaeNEY+DJT9pDYDMQjTE5QxwgWCGt2hwNuZ7luKhAfocXST3m Wubx17ISuRi0emtYQm6qpciyjM8Lxnznw6MyQayjSc+AsfTq94bFfL0RGx8VRuVO7+E3 g9IcKeuix8uujWq1d5h7+4GGpQ738qCgjUhD5qALcWkJPsT9tC+D8u+/WYz+8STG6bl4 qajQ== X-Gm-Message-State: APjAAAXUUJWaWJ7/t5w5SmKagI7mZFgIhDiQsz08Y17jQeSax61eRWRg JcZVhvUAAJRMzXzFjGJe+dg14MTELr81POK80I83GA== X-Google-Smtp-Source: APXvYqwYMdEjXlo/ZXkQ25Q7OqLij5wE38qfmFx+c4Kh6ETnZQ80hOGe2SgdovvfY1Nwmo4LDa9vLeLDcR91Ofxlyck= X-Received: by 2002:aca:ea57:: with SMTP id i84mr83905oih.73.1573598761920; Tue, 12 Nov 2019 14:46:01 -0800 (PST) MIME-Version: 1.0 References: <20191112000700.3455038-1-jhubbard@nvidia.com> <20191112000700.3455038-9-jhubbard@nvidia.com> <20191112204338.GE5584@ziepe.ca> <0db36e86-b779-01af-77e7-469af2a2e19c@nvidia.com> In-Reply-To: <0db36e86-b779-01af-77e7-469af2a2e19c@nvidia.com> From: Dan Williams Date: Tue, 12 Nov 2019 14:45:51 -0800 Message-ID: Subject: Re: [PATCH v3 08/23] vfio, mm: fix get_user_pages_remote() and FOLL_LONGTERM To: John Hubbard Cc: Jason Gunthorpe , Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Christoph Hellwig , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jens Axboe , Jonathan Corbet , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf@vger.kernel.org, Maling list - DRI developers , KVM list , linux-block@vger.kernel.org, Linux Doc Mailing List , linux-fsdevel , linux-kselftest@vger.kernel.org, "Linux-media@vger.kernel.org" , linux-rdma , linuxppc-dev , Netdev , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Nov 12, 2019 at 2:43 PM John Hubbard wrote: > > On 11/12/19 12:43 PM, Jason Gunthorpe wrote: > ... > >> - } > >> + ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags | FOLL_LONGTERM, > >> + page, vmas, NULL); > >> + /* > >> + * The lifetime of a vaddr_get_pfn() page pin is > >> + * userspace-controlled. In the fs-dax case this could > >> + * lead to indefinite stalls in filesystem operations. > >> + * Disallow attempts to pin fs-dax pages via this > >> + * interface. > >> + */ > >> + if (ret > 0 && vma_is_fsdax(vmas[0])) { > >> + ret = -EOPNOTSUPP; > >> + put_page(page[0]); > >> } > > > > AFAIK this chunk is redundant now as it is some hack to emulate > > FOLL_LONGTERM? So vmas can be deleted too. > > Let me first make sure I understand what Dan has in mind for the vma > checking, in the other thread... It's not redundant relative to upstream which does not do anything the FOLL_LONGTERM in the gup-slow path... but I have not looked at patches 1-7 to see if something there made it redundant.