Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3024934pxa; Tue, 25 Aug 2020 09:26:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIiSA/w4cN2hU355GDAc/TTE5wnhR61uYLTyTTtIZZF3Wtcczi8mDj60/W7gM4DNbEbSr5 X-Received: by 2002:a17:906:84cf:: with SMTP id f15mr11859378ejy.259.1598372761813; Tue, 25 Aug 2020 09:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598372761; cv=none; d=google.com; s=arc-20160816; b=cs/QOaYWTw/kWEQiGUaz6gKj9NKN7BwUuRTgaOpLMCLR3UCPLgMNXqJruarCRoQoS9 lfNBwzcntYpO/2r3ri+BnkSI3xxpjEcjC2/xNBxEMSZfTyPdFKy5EsNZisOXMXKCBpuJ 3uyqNHHhWdN+mkCzuLZIvrMr8JjEfRx68v9PROIFz2/KP4bAcZvq+i26SnNYCOUdRPAm ivnRmPtKb41BPrJITwIbhWAn5aPHq6r+hJ2L6UlQUjswVfJeJLs9MOZ49g/cjkIIgAHk 0+sKEVtdrSio/Rg8Ta9xvruXvvMNbbh+q3Nn2tcCnFNfIMvCrX3blsKys2rWLAw0a0TV 6dug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gj5tvB00t2fBLXjwCrSobBJ+bjW9aJbA2r5vUkdMM7w=; b=YnBMcMqTLclRd1bT7hNS742D9XiCSZaiTfqb0GJuHc2W0d+ic4zuLfcn4c7MWv2StF WsP3lBqVEn71zsDboxOCpceB7TmG76OJrN7z3NLdkGf5zojpBWmgzAXu2jhcm6CE4Mc0 /uypwbmQhqG2tmzgkpaRtwQxlN6ca1CfMiwsKDAz//9JVW3F1JsUeUT146xKtHzL83rm zH5+e+pvxNa2xWAVTqDEeLVgS62vN15QcaYbg2CJ7d/Q9inTPkR81xPFaA7l7FcHHgfw BWgPHyzqhmHMa6d756KVmyCQRUsjL6YLAV5+zG1KiL8lxkMYanVMyBSOgcLbaCMxygYM VTog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=HaQASwrH; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si9741013ejz.120.2020.08.25.09.25.36; Tue, 25 Aug 2020 09:26:01 -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; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=HaQASwrH; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726483AbgHYQY7 (ORCPT + 99 others); Tue, 25 Aug 2020 12:24:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726257AbgHYQY5 (ORCPT ); Tue, 25 Aug 2020 12:24:57 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 040F4C061574 for ; Tue, 25 Aug 2020 09:24:57 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id y65so2941227qtd.2 for ; Tue, 25 Aug 2020 09:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gj5tvB00t2fBLXjwCrSobBJ+bjW9aJbA2r5vUkdMM7w=; b=HaQASwrHHq62VPx9m6xhmYR415FPe7pkL7ibCGuEGzTc0XvMOPfS4H0PpZG5pE52+w cvl0TB7VNpm5LfnRATPCzr6XAH1WMbwPdTmgZDuUww/T5baMmbByaxOSSFu7lqMh/rfu 1t+uTnKFViI/jYlOSUAV7aVUVHWKeBnDWAqHPTpPCY2qvm+ZzbncPIl1AxkSxPG1rJlf uY62rn9HAYvIUHjLAxuiyILshEFYAZt5js0fRLF4uRCdkLPdnFJwvaNKSNd29jM4ZwNM bZ/b777T5bp19IIy6qd4OcDAeZ2LhtmEm0U7h6KkWXLXSEZMD1jPgrAUOjR6WPg/+t3l mPtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gj5tvB00t2fBLXjwCrSobBJ+bjW9aJbA2r5vUkdMM7w=; b=ihe006JoiV/Jhr47IexCrOsCLC5S+vy/gkmeKvICYzct39vBSh1WtHvhpmUV9vr82i k7Qa1N/fgtsIY7ddYeF+knKox8AuJr/2q+0JXnqWFYqYjrT1JQ74PWVsjUPL+8/Pqad8 FTEZbOukIckVFn3IywFl8pWtLApC+r53iGrUZ1VWwzb6im3TGvJBxliKfqIuE+yTWLVr 8ayzORaXNS+M7b6459rCNCqw/a4/nb7KCnit/0CqR/PMlMRsl7anKJ5TzBM2qaQAo4Jt bxAOg9bIDc+7dCTN06T23lcGabqL/pafAzQU8FnMU/ISv2/vh0ceWgnk9PUSd1kn69LP Zbvw== X-Gm-Message-State: AOAM533CwDWg/80WDO5EGp9Uo6p0JHIhZXVD+Ju6cjaaoqld1egnIsiH Daa2Y+JJ1dePAxcGiONDuZtCvg== X-Received: by 2002:ac8:4e2f:: with SMTP id d15mr9885085qtw.20.1598372695512; Tue, 25 Aug 2020 09:24:55 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:bdd3]) by smtp.gmail.com with ESMTPSA id a20sm14167382qtw.45.2020.08.25.09.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 09:24:54 -0700 (PDT) Date: Tue, 25 Aug 2020 12:23:42 -0400 From: Johannes Weiner To: Matthew Wilcox Cc: Jan Kara , linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/7] mm: Pass pvec directly to find_get_entries Message-ID: <20200825162342.GC932571@cmpxchg.org> References: <20200819150555.31669-1-willy@infradead.org> <20200819150555.31669-7-willy@infradead.org> <20200824161620.GK24877@quack2.suse.cz> <20200824173639.GD17456@casper.infradead.org> <20200825123324.GB32298@quack2.suse.cz> <20200825132814.GO17456@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825132814.GO17456@casper.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 02:28:14PM +0100, Matthew Wilcox wrote: > On Tue, Aug 25, 2020 at 02:33:24PM +0200, Jan Kara wrote: > > On Mon 24-08-20 18:36:39, Matthew Wilcox wrote: > > > 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. > > To be honest, I saw that as being the way forward for the page cache APIs. > If we're going to use a batching mechanism, it should be pagevecs, and > it should be built into the page cache interfaces rather than hanging > out off on the side. Agreed. > > > 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... > > I was thinking about this some more [1] [2]. I think we can get to the > point where find_get_pages(), find_get_entries() and find_get_pages_tag() > (and all their variants) end up taking a pagevec as their last argument. Agreed. > Also, I was thinking that all these names are wrong. Really, they're > mapping_get_pages(), mapping_get_entries() and mapping_get_marked_pages(). > So maybe I should move in that direction. That sounds like a lateral move in naming to me. The mapping prefix is a slight improvement, but without the "find" it sounds like a refcount operation and hides the fact that this is doing some sort of lookup and has higher complexity. It also makes working on this code easier on people not yet familiar with it at the cost of people familiar with it. Remembering new names for known concepts is a ton of mental churn. So IMO the new names should be unambigously and significantly better than the old ones to justify this. Signed: somebody who is still struggling with the change from exceptional entries in the radix tree to value entries in the xarray (Are pointers or integers the values? Aren't they both "values"?)