Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6067840ybh; Wed, 7 Aug 2019 16:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdPIf5pdf8ZFplry9nZ+Z/+QMA0EXvgjuRLpe/6f83wlUYZ3hIo3CcpXnNeWHMo85mQamB X-Received: by 2002:a65:51c1:: with SMTP id i1mr10040411pgq.417.1565221377541; Wed, 07 Aug 2019 16:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565221377; cv=none; d=google.com; s=arc-20160816; b=RBLQ3Ws1uIKge+9gVy6wA+BssvWHXNWwoIYFEXPYOHn+CxFxA46QpQCrxCXmuP/mwM i8Ys2TPcgrH4HmvbHpkJ4r8kxuT9Flf5oFtg/b1gEiW3/C7o8X0X/gkn9SjZEZ2RuNil FNAxWKnCFYQFzB8CI/Y30jL5oQl2bWAWQNXeFGWv3l+rH3EeNCgk004MZjR9GoMm2yGG bNuzmRR8dVj7YUuonjDDLJPZTXCaOPum+OtX3/ZMi5g6pa7ew9AUfc2evzyNXDBL16z0 E4lNFalitvWqjBHscxrEO0uSceIyjmjL5qKmkXOUZWc/EFQ1QtFGo/Yb+0DIxBVStXwo qspw== 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=Vo6bQKtkk9LxLaQR6PE8mmqutIpc3NqGB6BA5P1fNgE=; b=iMtfm0+IyfPR8P6y49n4eiO2hY9DjO3EfI/PVYnJWOWJjsRwXGWzvk1U+QoIfN79bQ A9zaGHU8Dm/NvWk5gTHoPLzLtF0OM94ORlN1+UJ6oItHrdWj/8Mq5aypYE6vG/MvfAZ5 td2t8zlu8JJWXYdyQQR/L6lVFqD+3YATi4L23Ad9wFXMlBqCMHj9AskMRVKfIu8GPi/H h3ci1z+xWU371CReoM1mSw2A8VAA6fc3jCn8T6cNB+6yzTfQMqy/J6WvBdEoI3eMeHfD zxNRYDrIAGsictQmQVXUDiD2F3V9VMGq4Sw4Lh4Lp715A3Y7SPcQbSSKAI1wjVddeiiA TvGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NrRvMjgZ; 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 z24si48291493plo.159.2019.08.07.16.42.41; Wed, 07 Aug 2019 16:42:57 -0700 (PDT) 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=NrRvMjgZ; 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 S2389086AbfHGXcK (ORCPT + 99 others); Wed, 7 Aug 2019 19:32:10 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:4118 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729624AbfHGXcJ (ORCPT ); Wed, 7 Aug 2019 19:32:09 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 07 Aug 2019 16:32:10 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 07 Aug 2019 16:32:08 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 07 Aug 2019 16:32:08 -0700 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; Wed, 7 Aug 2019 23:32:08 +0000 Subject: Re: [PATCH 1/3] mm/mlock.c: convert put_page() to put_user_page*() To: Michal Hocko , CC: Andrew Morton , Christoph Hellwig , Ira Weiny , Jan Kara , Jason Gunthorpe , Jerome Glisse , LKML , , , Dan Williams , Daniel Black , Matthew Wilcox , Mike Kravetz References: <20190805222019.28592-1-jhubbard@nvidia.com> <20190805222019.28592-2-jhubbard@nvidia.com> <20190807110147.GT11812@dhcp22.suse.cz> From: John Hubbard X-Nvconfidentiality: public Message-ID: <01b5ed91-a8f7-6b36-a068-31870c05aad6@nvidia.com> Date: Wed, 7 Aug 2019 16:32:08 -0700 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: <20190807110147.GT11812@dhcp22.suse.cz> 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=1565220730; bh=Vo6bQKtkk9LxLaQR6PE8mmqutIpc3NqGB6BA5P1fNgE=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=NrRvMjgZ026fJhY2X/UVob3ZUP7VbfQoX2fWC4rqAKy0rtWi8DdQ+dGpT9myh/Ups oQZ4iC5DhOS8fMX9OAOKdFdxT2+r22p977v74zrvGliO+4rYDr3xwzKQhhiD8261DI uWhhf3tl3zC3GIqtP7JRMFJvIf4rxZN5JgKREREk5KOERB6yo6bMNu88R4p5JniTVQ Ax29c0PctE88ki6fi9CXmAw1JGVRX10gWo12j1SVWJZ5rPCcUjzZjJhHpqbg9efdQP Kg7RC5y9sZF55OYmo73TeO6nKcqchTY2J4u2YycHEXaXJTEPbGcR6Y9t62fH1Tyy9A GpxiBAiRmC1Dg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/19 4:01 AM, Michal Hocko wrote: > On Mon 05-08-19 15:20:17, john.hubbard@gmail.com wrote: >> From: John Hubbard >> >> For pages that were retained via get_user_pages*(), release those pages >> via the new put_user_page*() routines, instead of via put_page() or >> release_pages(). > > Hmm, this is an interesting code path. There seems to be a mix of pages > in the game. We get one page via follow_page_mask but then other pages > in the range are filled by __munlock_pagevec_fill and that does a direct > pte walk. Is using put_user_page correct in this case? Could you explain > why in the changelog? > Actually, I think follow_page_mask() gets all the pages, right? And the get_page() in __munlock_pagevec_fill() is there to allow a pagevec_release() later. But I still think I mighthave missed an error case, because the pvec_putback in __munlock_pagevec() is never doing put_user_page() on the put-backed pages. Let me sort through this one more time and maybe I'll need to actually change the code. And either way, comments and changelog will need some notes, agreed. thanks, -- John Hubbard NVIDIA