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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 CC030CA9ED3 for ; Mon, 4 Nov 2019 20:37:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83D6A2089C for ; Mon, 4 Nov 2019 20:37:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="TG8Hk1Ne" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83D6A2089C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 35D7B6B0003; Mon, 4 Nov 2019 15:37:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30F4F6B0005; Mon, 4 Nov 2019 15:37:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AFC16B0006; Mon, 4 Nov 2019 15:37:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id F227C6B0003 for ; Mon, 4 Nov 2019 15:37:04 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id A53CD3CFB for ; Mon, 4 Nov 2019 20:37:04 +0000 (UTC) X-FDA: 76119754368.01.pear65_77f54e00c3d03 X-HE-Tag: pear65_77f54e00c3d03 X-Filterd-Recvd-Size: 6137 Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Nov 2019 20:37:04 +0000 (UTC) Received: by mail-qk1-f193.google.com with SMTP id 15so18984752qkh.6 for ; Mon, 04 Nov 2019 12:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rGN1CMMcv27mrbyjqTfJtMw4/MfiXe8ZUNAjLnIfNc8=; b=TG8Hk1NeRC++G6+F2yPv9zRlkB5zmpjIx9ZuDUNKab/C+J6d7xxfOxxIO7eKgvsTt+ p3r7qXvBb+Zz3r5NF9wt7yEiPQTVgxKnL+HEF2RNhT/2isit4pN3VfgQ2DIpr/R7/4Hw u7TwLaFjyPwmRXIFAaBFi4fpQejOEyaDwRD+BmP4qgv0NQc4ENsX+0jMxqrPG0iCiCMO 7RWUYzK0XfILQOzslmYaqc8eKt7DtdAn4YRVb6r7EuXFpZ7WiuUUv4iKaUItPpl758jM 1rA117djJwEsfQGPp7Z0dJc7+OtMVamSH8lioe2hkB5VkJCtZKnaAY/7jmqeoI1EBbdB D0lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rGN1CMMcv27mrbyjqTfJtMw4/MfiXe8ZUNAjLnIfNc8=; b=nQjeyOVUsJgoHbJITyoqjfOy3tN/UyI9cX/iBwtUiZefuwHgegCSbwWeJ1Rd+TPqG/ D5+3L7tTpDSwZhsQeLPnypckq4k6EfviR8qgM2NJqW2qY0uSFwOaGn0fO6+H+LpRMvip Glc/5NurMq4s9KOXBzEafM0UjMTChTEH8LKPGNSKaEs1I4325u9j2COniKtc7znk/ckz RPJsjTwEPuebo4X6+d4ANrlSqD7wiYyDMkpBqggdTZG3+NPmHgeIPjMb4FF2DZArzDIT UCi4/n7NWl+WbYmCMXWMZ/NuuNkR9fadpF+SrV7rhyNGkXXRxA9X+3XOfZXaL1vk0tYs jFqg== X-Gm-Message-State: APjAAAVPmBOGUZKOf0Y0OEk/Vgkpc/BHh1G8IskqUHLX9H9yJaAiR2Fz M9WmxVwprAW4sciG0uh73E03+g== X-Google-Smtp-Source: APXvYqyT2XrB8OH9lK27HX22fLNbm8bipIFqvEED+1gyXtGC25AghyQahqXSG6rV31VKukiCJdMK8w== X-Received: by 2002:a05:620a:90a:: with SMTP id v10mr18785575qkv.195.1572899823664; Mon, 04 Nov 2019 12:37:03 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-113-180.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.180]) by smtp.gmail.com with ESMTPSA id u189sm9293005qkd.62.2019.11.04.12.37.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 04 Nov 2019 12:37:03 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iRj5y-0005JK-NP; Mon, 04 Nov 2019 16:37:02 -0400 Date: Mon, 4 Nov 2019 16:37:02 -0400 From: Jason Gunthorpe To: Jerome Glisse Cc: John Hubbard , Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jens Axboe , Jonathan Corbet , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf@vger.kernel.org, dri-devel@lists.freedesktop.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 05/18] mm/gup: introduce pin_user_pages*() and FOLL_PIN Message-ID: <20191104203702.GG30938@ziepe.ca> References: <20191103211813.213227-1-jhubbard@nvidia.com> <20191103211813.213227-6-jhubbard@nvidia.com> <20191104173325.GD5134@redhat.com> <20191104191811.GI5134@redhat.com> <20191104195248.GA7731@redhat.com> <25ec4bc0-caaa-2a01-2ae7-2d79663a40e1@nvidia.com> <20191104203153.GB7731@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104203153.GB7731@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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 Mon, Nov 04, 2019 at 03:31:53PM -0500, Jerome Glisse wrote: > > Note for Jason: the (a) or (b) items are talking about the vfio case, which is > > one of the two call sites that now use pin_longterm_pages_remote(), and the > > other one is infiniband: > > > > drivers/infiniband/core/umem_odp.c:646: npages = pin_longterm_pages_remote(owning_process, owning_mm, > > drivers/vfio/vfio_iommu_type1.c:353: ret = pin_longterm_pages_remote(NULL, mm, vaddr, 1, > > vfio should be reverted until it can be properly implemented. > The issue is that when you fix the implementation you might > break vfio existing user and thus regress the kernel from user > point of view. So i rather have the change to vfio reverted, > i believe it was not well understood when it got upstream, > between in my 5.4 tree it is still gup_remote not longterm. It is clearly a bug, vfio must use LONGTERM, and does right above this remote call: if (mm == current->mm) { ret = get_user_pages(vaddr, 1, flags | FOLL_LONGTERM, page, vmas); } else { ret = get_user_pages_remote(NULL, mm, vaddr, 1, flags, page, vmas, NULL); I'm not even sure that it really makes any sense to build a 'if' like that, surely just always call remote?? Jason