Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1037389ybc; Tue, 12 Nov 2019 13:13:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwHnRUb6zbAB3JH0Z49ocdRI7c+/W5Mxt8NzyzKsb/8CJEStM9iU65GO1epW2KAYlTbGuYd X-Received: by 2002:a17:906:c41:: with SMTP id t1mr888503ejf.282.1573593182422; Tue, 12 Nov 2019 13:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573593182; cv=none; d=google.com; s=arc-20160816; b=knogLHZNP0KGdX6JIZZDz4/O+/akNpxGhESVEiCQrRCotx/CIHzP3K1uf5dbbN3XNW uDmPGZTOVxdg0p+FFUWo3jp/51KnNiqj9GvNtKhxH/t3sa8i3Dtv6X1ocE04aFLFAjWy d1REA8su9lTfE2+veRNIo79kYvZJq7xTZ1oOROrK78iOfPODBZBlxJEsiU9z5dVGAIIY nxkUsYdgTmhA2z8FlS2VwHjck3ycIhDOGyhk1eivq6MaqeQ1wY9WHtU/C8tVIY+fQ7Ta noIqIwqX8cJ2Pfn8pRnpSu4B4lG2bSYSm7ZfcUxV6tYcoKSwZKe1h6sTj1C9QPlMNky9 oX5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=FYNiQqIIwAjaPTLdgZDFjzpc3PZA+IOd8Qzq/L3NYFI=; b=gkKzrvz3K4qDOZY3Hi+jfSsQwnLz97PQ5pFiEc3WYrc/a6KQrmFSFDI+jwANNozwSs vuSX7xy4t63ov63FV5Bct8aIH1lmndxFBbKcsFBRFsS+tSQe406U+RLk1Lp2tPMMoDsI 3WSocFltk18MqWKSEMOoNCSFNb9RnjTwI81NUsu8BRU+5Y/LMQvdBm1cxmkL9V/+M36O fitL5l2r+HFm8kHumPip96x5lkVHWpnAFGCJSr0mZMe1ZI/zZz2fdzr+wKwBv3lJkntT GRkGd5M5RZHBB/Mndn2yhlBgINW2278rMD4PuPrhM3jo9WVxzw8Q0cfVWW6GHrFNMBqg ybng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="XDTPGbX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29si17496717edb.156.2019.11.12.13.12.37; Tue, 12 Nov 2019 13:13:02 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b="XDTPGbX/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727312AbfKLVKx (ORCPT + 99 others); Tue, 12 Nov 2019 16:10:53 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:1270 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727239AbfKLVKw (ORCPT ); Tue, 12 Nov 2019 16:10:52 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 12 Nov 2019 13:09:52 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 12 Nov 2019 13:10:48 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 12 Nov 2019 13:10:48 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 12 Nov 2019 21:10:47 +0000 Subject: Re: [PATCH v3 00/23] mm/gup: track dma-pinned pages: FOLL_PIN, FOLL_LONGTERM To: Jason Gunthorpe CC: 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 , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , , , , , , , , , , , , , LKML References: <20191112000700.3455038-1-jhubbard@nvidia.com> <20191112203802.GD5584@ziepe.ca> X-Nvconfidentiality: public From: John Hubbard Message-ID: <02fa935c-3469-b766-b691-5660084b60b9@nvidia.com> Date: Tue, 12 Nov 2019 13:10:47 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191112203802.GD5584@ziepe.ca> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1573592992; bh=FYNiQqIIwAjaPTLdgZDFjzpc3PZA+IOd8Qzq/L3NYFI=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=XDTPGbX/pfLSLEPMZj0U4ST8nWeqLQb9L0gJo2fojuRXhn2sbJZCbDvwG00vq+XIQ colylZtLpZg40dx1ABr6UMyL7nDz+Ko0zZq5udmfA2v8o8KV6jbQ8nMJaMjSxXz3jT /IQas6U39IMXowKsu+Lp15YvwNvsj9I4GEW1qSNrdbdQur8MbFNPpL74slNbnNTKiw 2tvXn1JIXwNPZ2+bJmHJ2nQzCpfl0RwWLH4Y7hj0SisnidmxgFdWv36tY7VU9S2345 uRxyqWTOY6lQqCfoY1uSgUmsGBjI6laWSw8oWM5BJSMXcH/MubF7tkJ0NoA3AfLsvB eNrIf7Db8lhiQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/12/19 12:38 PM, Jason Gunthorpe wrote: > On Mon, Nov 11, 2019 at 04:06:37PM -0800, John Hubbard wrote: >> Hi, >> >> The cover letter is long, so the more important stuff is first: >> >> * Jason, if you or someone could look at the the VFIO cleanup (patch 8) >> and conversion to FOLL_PIN (patch 18), to make sure it's use of >> remote and longterm gup matches what we discussed during the review >> of v2, I'd appreciate it. >> >> * Also for Jason and IB: as noted below, in patch 11, I am (too?) boldly >> converting from put_user_pages() to release_pages(). > > Why are we doing this? I think things got confused here someplace, as Because: a) These need put_page() calls, and b) there is no put_pages() call, but there is a release_pages() call that is, arguably, what put_pages() would be. > the comment still says: > > /** > * put_user_page() - release a gup-pinned page > * @page: pointer to page to be released > * > * Pages that were pinned via get_user_pages*() must be released via > * either put_user_page(), or one of the put_user_pages*() routines > * below. Ohhh, I missed those comments. They need to all be changed over to say "pages that were pinned via pin_user_pages*() or pin_longterm_pages*() must be released via put_user_page*()." The get_user_pages*() pages must still be released via put_page. The churn is due to a fairly significant change in strategy, whis is: instead of changing all get_user_pages*() sites to call put_user_page(), change selected sites to call pin_user_pages*() or pin_longterm_pages*(), plus put_user_page(). That allows incrementally converting the kernel over to using the new pin APIs, without taking on the huge risk of a big one-shot conversion. So, I've ended up with one place that actually needs to get reverted back to get_user_pages(), and that's the IB ODP code. > > I feel like if put_user_pages() is not the correct way to undo > get_user_pages() then it needs to be deleted. > Yes, you're right. I'll fix the put_user_page comments() as described. thanks, John Hubbard NVIDIA