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=-8.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 2B5A4C433DF for ; Tue, 25 Aug 2020 12:33:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CFBCB2075F for ; Tue, 25 Aug 2020 12:33:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFBCB2075F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 651E38E000E; Tue, 25 Aug 2020 08:33:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 628B28E0006; Tue, 25 Aug 2020 08:33:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53ED48E000E; Tue, 25 Aug 2020 08:33:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 3BF678E0006 for ; Tue, 25 Aug 2020 08:33:31 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id F16513638 for ; Tue, 25 Aug 2020 12:33:30 +0000 (UTC) X-FDA: 77189031780.04.soap68_5c0e9832705b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id C8AAC800E08D for ; Tue, 25 Aug 2020 12:33:30 +0000 (UTC) X-HE-Tag: soap68_5c0e9832705b X-Filterd-Recvd-Size: 3691 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Aug 2020 12:33:30 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 88B06AD77; Tue, 25 Aug 2020 12:33:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 434B31E1316; Tue, 25 Aug 2020 14:33:24 +0200 (CEST) Date: Tue, 25 Aug 2020 14:33:24 +0200 From: Jan Kara To: Matthew Wilcox Cc: Jan Kara , linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , Johannes Weiner , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] mm: Pass pvec directly to find_get_entries Message-ID: <20200825123324.GB32298@quack2.suse.cz> References: <20200819150555.31669-1-willy@infradead.org> <20200819150555.31669-7-willy@infradead.org> <20200824161620.GK24877@quack2.suse.cz> <20200824173639.GD17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200824173639.GD17456@casper.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: C8AAC800E08D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Mon 24-08-20 18:36:39, Matthew Wilcox wrote: > On Mon, Aug 24, 2020 at 06:16:20PM +0200, Jan Kara wrote: > > On Wed 19-08-20 16:05:54, Matthew Wilcox (Oracle) wrote: > > > All callers of find_get_entries() use a pvec, so pass it directly > > > instead of manipulating it in the caller. > > > > > > Signed-off-by: Matthew Wilcox (Oracle) > > > > Rather than passing pvec to find_get_entries() and then making everybody > > use it, won't it more consistent WRT the naming to make everybody use > > pagevec_lookup_entries() (which is trivial at this point in the series) and > > then rename find_get_entries() to pagevec_lookup_entries()? I.e., I'd prefer > > if the final function was called pagevec_lookup_entries() because that is > > IMO more consistent with how other functions are named in this area... > > It seemed more consistent to me to have everybody using > find_get_entries(). To me the pagevec functions: > > 1. Are in mm/swap.c (not really sure why) Historical :). AFAIK pagevec abstraction was first created to make swapping out and reclaim of pages more effective. It has grown a bit since then... > 2. Take pvec as the first argument, not the last Well, yes, I'd keep the argument order to match original pagevec_lookup_entries(). > 3. Wrap a find_* function > > Whereas the find_* functions: > > 1. Are in mm/filemap.c > 2. Take mapping as the first argument > 3. Manipulate the XArray directly Agreed. > We already have functions in filemap which take a pagevec, eg > page_cache_delete_batch() and delete_from_page_cache_batch(). Right but those are really pretty internal helper functions so I don't think they form or strong precedence. > So if we're going to merge the two functions, it seems more natural to > have it in filemap.c and called find_get_entries(), but I'm definitely > open to persuasion on this! I agree that having non-trivial xarray code in mm/swap.c isn't attractive either. Dunno, I dislike the inconsistency between find_get_pages() and find_get_entries() you create but they aren't completely consistent anyway so I can live with that. Or we can just leave the pagevec_lookup_entries() wrapper and the API will stay consistent... Honza -- Jan Kara SUSE Labs, CR