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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 87C96C5519F for ; Sat, 14 Nov 2020 15:23:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 880F02225E for ; Sat, 14 Nov 2020 15:23:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="a8teAqDF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 880F02225E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B84466B0068; Sat, 14 Nov 2020 10:22:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B34036B006C; Sat, 14 Nov 2020 10:22:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A490C6B006E; Sat, 14 Nov 2020 10:22:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 78A476B0068 for ; Sat, 14 Nov 2020 10:22:59 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 0B1A0180AD807 for ; Sat, 14 Nov 2020 15:22:59 +0000 (UTC) X-FDA: 77483391678.23.farm80_61116e227318 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin23.hostedemail.com (Postfix) with ESMTP id DE1A337606 for ; Sat, 14 Nov 2020 15:22:58 +0000 (UTC) X-HE-Tag: farm80_61116e227318 X-Filterd-Recvd-Size: 2599 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Sat, 14 Nov 2020 15:22:56 +0000 (UTC) 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> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.