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=DKIMWL_WL_HIGH,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 7D92EC47257 for ; Thu, 7 May 2020 18:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5AFC92145D for ; Thu, 7 May 2020 18:44:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="FkNbon+/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728198AbgEGSoY (ORCPT ); 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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