Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp60710ybx; Thu, 31 Oct 2019 15:57:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5lHdOkqCG0AB/IwB0m8PqfGXLShE+QtZWifiGEwwMdDx1nDAYDGl/nWRjjbhrAQX3AeK0 X-Received: by 2002:a17:906:4488:: with SMTP id y8mr6709669ejo.322.1572562651343; Thu, 31 Oct 2019 15:57:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572562651; cv=none; d=google.com; s=arc-20160816; b=rRW6okZS22xlZECZoXA7T3UOOnpJI8hjp5sz3up/P5TjrftOLbhB/G07J44jfKTC5j 7Ex7G18I5jwML5+I2OrIJN01uuVoXqquLT1lnll+OY6Vr4xpSeeLMI+qqD3xpUPZ46wc ZtANhaJwoaPnuXBXR06qEUGk4lcLNQnG7SN14COKj6qXPPMITEGwvy6yFTMsBwh/vO6/ AUK8E8vK4td1NTQe4qLsSN9Wjh/WaUmnPOQ+uORUD/vdUIxTA7tzYxRrA3vgGXkJ8dir 2A+EAOAA2as9UEMEHViOjIEd3yWI9e8ciL+8L08sxtOUXdDGDW+ooeJxS6H7tnCjuU6s jU8w== 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=St3Rf/REgq/1do28NhYtGJF/+ie61nX3HJRKUe+Kv+8=; b=ZCLiVuDXUZ1Xi18vAqxeWfFKWXyALr8NgN19hZ07CLxsRibRoSGjBZDp7fboHYcpg2 xcGsapcf9Hq6LoH+KwFTCIzSBfuQ/4V+CL5Y1fZOgPq1Ha1jmQIgS1L72AxYvBMw9+VS 8iX80ZexBorYoarR0ZacM3Qz+SwHZt37FaM60/L8/sLtBObeAFXVP3OLMaa0N3DfwUzg bZZd0BpTJpGTD1Yxc77BA2vcIblMyTy8Ubro8MHxeAAmEgV/fwOJH/hA1Lw0jW8rvh52 Qb95fZbRzt6JBVfZPezvnzqkHVdNCaRXiCH3h/VSH9c7Bj4SSLQVB9mfvfWhAcnqXlMy WKbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=ikqeCXUq; 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 f13si4588264ejw.297.2019.10.31.15.57.07; Thu, 31 Oct 2019 15:57:31 -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=ikqeCXUq; 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 S2387395AbfJaWBO (ORCPT + 99 others); Thu, 31 Oct 2019 18:01:14 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:14553 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728345AbfJaWBN (ORCPT ); Thu, 31 Oct 2019 18:01:13 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 31 Oct 2019 15:01:14 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 31 Oct 2019 15:01:08 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 31 Oct 2019 15:01: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; Thu, 31 Oct 2019 22:01:07 +0000 Subject: Re: [PATCH 02/19] mm/gup: factor out duplicate code from four routines To: Ira Weiny 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" , Jan Kara , Jason Gunthorpe , 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 , Christoph Hellwig , "Aneesh Kumar K . V" References: <20191030224930.3990755-1-jhubbard@nvidia.com> <20191030224930.3990755-3-jhubbard@nvidia.com> <20191031183549.GC14771@iweiny-DESK2.sc.intel.com> <75b557f7-24b2-740c-2640-2f914d131600@nvidia.com> <20191031210954.GE14771@iweiny-DESK2.sc.intel.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <5cb84804-be12-82e8-11d8-7e593fd05619@nvidia.com> Date: Thu, 31 Oct 2019 15:01:07 -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: <20191031210954.GE14771@iweiny-DESK2.sc.intel.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) 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=1572559274; bh=St3Rf/REgq/1do28NhYtGJF/+ie61nX3HJRKUe+Kv+8=; 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=ikqeCXUqsTwoQB5CbB+62UgGOxuiKLZDrBsuVMEaD9IjjDxXb09OkVp8xOPRF5wct ee5DhXFx3ncNZEuTcZeSOQivxIJokuWUNeY+2vtv3ZOkk1HWJjkj1h2EH0AXlwb+WX k+12VWYeIpYnIAMc/9Jx/3qdPSGK+huRjsgTXXwezXTbb/FzDozYDlQdAsy+QX8f3z guPaB2LcynNr/sr3xHEr7wV68E214NkgY5BRukBI2Kt+YqGU/HP5jxWqLsbWsS/eGt xEDw4hf53LcGHOIM9YJEHjAqS/wG8o7OePI2ydIId+OliMRlMyINElUiwkTZonGlbb If9KlbJQJnB+Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/31/19 2:09 PM, Ira Weiny wrote: > On Thu, Oct 31, 2019 at 11:43:37AM -0700, John Hubbard wrote: >> On 10/31/19 11:35 AM, Ira Weiny wrote: >>> On Wed, Oct 30, 2019 at 03:49:13PM -0700, John Hubbard wrote: >> ... >>>> + >>>> +static int __huge_pt_done(struct page *head, int nr_recorded_pages, int *nr) >>>> +{ >>>> + *nr += nr_recorded_pages; >>>> + SetPageReferenced(head); >>>> + return 1; >>> >>> When will this return anything but 1? >>> >> >> Never, but it saves a line at all four call sites, by having it return like that. >> >> I could see how maybe people would prefer to just have it be a void function, >> and return 1 directly at the call sites. Since this was a lower line count I >> thought maybe it would be slightly better, but it's hard to say really. > > It is a NIT perhaps but I feel like the signature of a function should stand on > it's own. What this does is mix the meaning of this function with those > calling it. Which IMO is not good style. > > We can see what others say. > Sure. I'll plan on changing it to a void return type, then, unless someone else pipes up. thanks, John Hubbard NVIDIA