Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1940624pxb; Sat, 14 Nov 2020 07:25:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXo5RoGcjff4vxV36DQbM3qnpWRHrfX17Ayfel07hAuk2qUA42paM+LN0NF0Fd/1wzUb+I X-Received: by 2002:a05:6402:b3b:: with SMTP id bo27mr7732081edb.376.1605367552491; Sat, 14 Nov 2020 07:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605367552; cv=none; d=google.com; s=arc-20160816; b=CqHX3NM3E88yhUzkym6WWKct6uvj/t0InAMfKnLNyIfShSetcsdHCdUvgbNucVusFQ a2mspYlHJzCL+im5UKD/8NOo3wUEniOwcYv6x0lhmLJKjhzIhxQ8rm1yz8dP7SLiM/1k IcZPjT9EGRu+S0SZBAGBH+MIpBGKPmIan/BjRtBFcUdTn95UR3hulZbg3ir2DllZwA4H gAhge6oLVcAnDOSG4niXJHoWTsAYKoO7U8NGZV876djqU4IRt79rYEuQP0C3rM1pP1bg 45X0R53Yfx/fzHkW3MShfWimygVwm7L5ZAuSnCfbURjNp4ZPrV+jjXaMJcN1AU2aXqpo G/sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6JrlagLDzZmUvhluP8XB/lv8Ud+95jz6vB9eZHvFliQ=; b=o0mRNC2aTXRVgWcbqA6VpArWLzufPbXgTMQ1ozXAOVnxRkMledY1/P898SgRd0Omxd Xvyn9T0ZXaBS7eSvNYZqgxckNOnYbsf7j/4ohZYHnGRDzva6nyrSxv4zt8hmxkaXg1GW Y3cTAuYFok1Xh/XeCEufNA4s6qthRGXZ6DQ7xxHbJAack6TV72TnM/f3jOAVNjHuJTJd uOrf+TP4ZqG/LHJ4omWgQ9sA37FgsOujVRI5dmUpQbziKCTcKcp/1e4qyZMIpcmu6iJr XL6bu7LhT1RfQts4xlN/PumpFpCDAxKuvVZLppJKc1yuSAHCGLGV0rGhBIz0jtGm8nDz ULRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=a8teAqDF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u23si8706482edq.36.2020.11.14.07.25.28; Sat, 14 Nov 2020 07:25:51 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=a8teAqDF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727044AbgKNPWz (ORCPT + 99 others); Sat, 14 Nov 2020 10:22:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbgKNPWz (ORCPT ); Sat, 14 Nov 2020 10:22:55 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F1AC0613D1; Sat, 14 Nov 2020 07:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=6JrlagLDzZmUvhluP8XB/lv8Ud+95jz6vB9eZHvFliQ=; b=a8teAqDFl+rInAIZaN9hsHpPFa q8JEPPQrGvab2DAIvKwqKR24il+FYBW02+W16dHNN5m+Hu1qGWokX9ClibtYB7goEYW8xilz0IpU2 A54vxIbH15PMQl8t5U53vxwUPPC4Se2eTxzaphTJHOdFbKK6PAL0RBV8fbYB+NiVAgQKH8nu3hVtP XiCq3E15OLZYYX78Q85vZeuQLZ+5X+UZ5XjJ3y46qYpDwqfBp1JqpqLljlwS+NbXd3TNKFPWalSFH qjc85gxlEJfuk/IMkSxM6aoItIvLqY+XWBNW97uM9lx1CYsuUT0gAvq9Rhm9fi/+NgM7nGYit/Vmm N5IWgaiQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kdxO9-0001Qp-1m; Sat, 14 Nov 2020 15:22:53 +0000 Date: Sat, 14 Nov 2020 15:22:52 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, hughd@google.com, hannes@cmpxchg.org, yang.shi@linux.alibaba.com, dchinner@redhat.com, linux-kernel@vger.kernel.org, Jan Kara , William Kucharski Subject: Re: [PATCH v4 13/16] mm: Pass pvec directly to find_get_entries Message-ID: <20201114152252.GM17076@casper.infradead.org> References: <20201112212641.27837-1-willy@infradead.org> <20201112212641.27837-14-willy@infradead.org> <20201114102133.GN19102@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201114102133.GN19102@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Nov 14, 2020 at 11:21:33AM +0100, Christoph Hellwig wrote: > On Thu, Nov 12, 2020 at 09:26:38PM +0000, Matthew Wilcox (Oracle) wrote: > > + pvec->nr = ret; > > return ret; > > Do we need to return the number of found entries in addition to storing > it in the pagevec? We really only need a bool -- is pvec->nr zero or not. But we have the number calculated so we may as well return it. All the current find_*() behave this way and I haven't seen enough reason to change it yet. Making it return void just makes the callers uglier. I have a batch of patches to do something similar for find_get_pages / find_get_pages_range / pagevec_lookup / pagevec_lookup_range, but I don't need them for the THP patchset, so I haven't sent them yet.