Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2885547pxa; Tue, 25 Aug 2020 06:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL6JwhvIOgKX5LQYfSakpr+mV9aLGTdcU111PNGGiCr8XeDjz9CkeMy2NUlRukddICiE+J X-Received: by 2002:aa7:df84:: with SMTP id b4mr9822333edy.75.1598361044267; Tue, 25 Aug 2020 06:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598361044; cv=none; d=google.com; s=arc-20160816; b=YHtQe1w8E0nQ27Pcc5rMsDbeXgggqg115n5Q1oNeOF+BrzJ45m1BGRSWgBVJBjp4gk oUIeqpXb8xsv8n0bv+rM7wBuo/U20LOxdGAEm4fI91hYL176GclNCz/mNUbyF48VBo+O /rzEjAtV0yMovXFE1S64ynBJ60mqQjk+QCiu3KKGpjKFV5HC6IvOQkQ47pF+AmqLkP4n Bxjwsvm5QB0puB6Rliluy31lAvROBhF5Ol9xCKc7rMmrbR5+4jh+wgYM3QrB4Ip0AFg/ 9XrlmxDy3AKmydUZukW+vJKdFIwd7E1NxM/JiO7uW4ar5qQ052vredja7ySoAn5CvlBu fvSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=HyesVkGRkmjKYHBYCi0AtOQrwbj0kedAR9rYNJ3ZNTI=; b=Qzf19Mzz/49/bH423EOK6nWAI4lapzUbd29yBRkjggyB0ZSL71B7ZLOJ+WGDJlZ2j9 a2fBSkIFpwil8TQ8k5Il/UtVNreTtyiTPIoIpgTTbuK//T6ImgfsUnDmHeXqdS/NyZRo YBNlnxnVUVYbjNHCxPBb53XLbqlX9GgcpDf+hTU4XhXPsOnBRW2gkYmnlz5NR9wCNDfD 0Jl3pUMXYiKvOmCxr7G0JbpFlfZklaLX+AGviv4kxU87bVm7WomF2tG7poikyyAOmDHz ZVmskinzx5EXhnLKt+z85ANh87+SJvMamrzg94MJP4Bb8UB/+FDvpuchd+4yYZ4DnPIp YZrA== ARC-Authentication-Results: i=1; mx.google.com; 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 y23si4455455ejf.437.2020.08.25.06.10.21; Tue, 25 Aug 2020 06:10:44 -0700 (PDT) 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; 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 S1726886AbgHYMda (ORCPT + 99 others); Tue, 25 Aug 2020 08:33:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:53218 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726691AbgHYMda (ORCPT ); Tue, 25 Aug 2020 08:33:30 -0400 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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