Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp975669ybj; Thu, 7 May 2020 11:48:12 -0700 (PDT) X-Google-Smtp-Source: APiQypIuQiU2xFHtl4yBT9phFDWQYTlBtUlu0u0StNXAk8SlEQhfZITW/bvORrhEPZkAjUZoVCnf X-Received: by 2002:a17:906:2ad4:: with SMTP id m20mr13889036eje.324.1588877292345; Thu, 07 May 2020 11:48:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588877292; cv=none; d=google.com; s=arc-20160816; b=Aw9psGgtOMcrq4g0LHfdGQGv7AoOZGGy7CkvaMa77lhpx/2mpBUU52rIacGiVae6RE vrql5h5GMun+dh/v91I8Y+VwK1E+bgLL6ltN8/JxpNIBOYK6DPyhRRHjYneSIy9GewlD 3Miz3w02ds32dzotWCIQl4QaOLY/W9z4zMUauN4gbmC8Ii9LQ1bwh1l4ul4zX8XBmGGx dg2e5tkk/I2EbtKVsxuAciaI7Y8uUSCvvjlqBPilA5tgmURDe0G6pCPBxd3JBkjBJfU8 jNk2Z4GJ+rSI9NkmzJQxdDt2YgYBJlijnpijdYy7cFAhLmxv+PNRKN1cYLs4Liv4ec2i BB5Q== 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=s0GB/xjC+YXiEqpbpZ38ACIIfPDrfZoEl489zOuwW70=; b=Md0NN+Ip4V0AXSR1mNia/zYj49ygCzz1xfoNHvLTD6BlzZaTFjVRnwWHZWh0AK9nc/ P9saysOjXBi7e5MRKB4r0QSg1z3d2+1jkweEw7Izjnfue+Dr4cfG2gi2DPAZaL8WQ8DT 67kHlVOUTqv5kY3Idf4oBH9Lx8SbYmX65OWm0AtYGGbs43ZIdpiZXM+98JY7PdyhC36b PXK130q6bl6XUioIhag65RjUjs5Lqc0eRPZS/QT+g/6vY3YmjeqPDCfldXL7uJJLjV3K UjlDgLRvhos4evuQzr2xI1IL7Ju3ynWjcg3u9u3oVQpUnb5HUybMvFyXKyoX3EDU4ogu 4O7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="FkNbon+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id s16si3659058ejr.170.2020.05.07.11.47.48; Thu, 07 May 2020 11:48:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b="FkNbon+/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728237AbgEGSoY (ORCPT + 99 others); Thu, 7 May 2020 14:44:24 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:5956 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbgEGSoY (ORCPT ); Thu, 7 May 2020 14:44:24 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 07 May 2020 11:43:12 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 07 May 2020 11:44:23 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 07 May 2020 11:44:23 -0700 Received: from [10.2.55.176] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 7 May 2020 18:44:23 +0000 Subject: Re: [RFC] mm/gup.c: Updated return value of {get|pin}_user_pages_fast() To: Souptick Joarder , Jan Kara CC: Tony Luck , , Rob Springer , Todd Poynor , , Greg KH , Jens Wiklander , Andrew Morton , , "David S. Miller" , , Ira Weiny , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , , , "open list:ANDROID DRIVERS" , , Linux-MM , , , References: <1588706059-4208-1-git-send-email-jrdr.linux@gmail.com> <0bfe4a8a-0d91-ef9b-066f-2ea7c68571b3@nvidia.com> <20200506100649.GI17863@quack2.suse.cz> <20200506125930.GJ17863@quack2.suse.cz> <20200507101322.GB30922@quack2.suse.cz> From: John Hubbard X-Nvconfidentiality: public Message-ID: <03bbc0f3-8edc-6110-6391-e540f773954c@nvidia.com> Date: Thu, 7 May 2020 11:44:23 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: 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"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1588876992; bh=s0GB/xjC+YXiEqpbpZ38ACIIfPDrfZoEl489zOuwW70=; 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=FkNbon+/lZBBjz9hvkzpf8XLqnxFhTzELzTdyEKvRurk0aqMSHwD85ZQ4E7KrBaQR yvRSZEof1rMLcBARCOie6dDXHCRtJ6bX5o0M/30EtLT8wkidpsRgm1sAq5o8X1AYEf ig/myAgWJBZambQrAm4QfpVWNRzk5lA/cuF17BMOs/H00NIHnt/EiCv2Mi0MJgUaW8 h/Tgfv4rUsuFQMKZC8/Z5izGkLhmkLb136CD93D+e6sy5bQZdnUnwN6nDSEOWnLbny Lxw9pZdGOYtcDe5ymjtNUpKpBQUA87UMJMZ88DSlXVfnnIQYcIsGYSNMo4qeVJRrUS szSLg14PEX/NQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-07 03:32, Souptick Joarder wrote: ... >> OK, so no real problem with any of these callers. I still don't see a >> justification for the churn you suggest... Auditting all those code sites >> is going to be pretty tedious. > > I try to audit all 42 callers of {get|pin}_user_pages_fast() and > figure out these 5 callers > which need to be updated and I think, other callers of > {get|pin}_user_pages_fast() will not be > effected. > > But I didn't go through other variants of gup/pup except > {get|pin}_user_pages_fast(). I feel the need to apologize for suggesting that a change to -EINVAL would help. :) If you change what the return value means, but only apply it the gup/pup _fast() variants of this API set, that would make the API significantly *worse*. Also, no one has been able to come up with a scenario in which the call sites actually have a problem handling return values of zero. In fact, on the contrary: there are call site where returning 0 after being requested to pin zero pages, helps simplify the code. For example, if they're just doing math such as "if(nr_expected != nr_pages_pinned) ...". This looks like a complete dead end, sorry. thanks, -- John Hubbard NVIDIA