Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp416286pxa; Thu, 27 Aug 2020 06:06:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB7RKFrRzgPLTcGLD97y2NCTIkODWx9LLvXerpsLWgYIz9YlrbsYV2t4KdoG1aF4HD+1xH X-Received: by 2002:a17:906:4813:: with SMTP id w19mr20154434ejq.159.1598533617936; Thu, 27 Aug 2020 06:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598533617; cv=none; d=google.com; s=arc-20160816; b=FsqfJYRQwWvxNL+mqMh4Ao4xUJOgsMLa1krV9siGymmyJCX1nPp2JRQERRLmMlu6J1 frTR0kO6yoBHIvw6NOWvb45dPNoUfqN+jFHBEurueZ0TNiYATqafUKjhX9+j5nIgFQ1i aC+1Ck92OoR4K0ngxNIiQekqNNh8YyzBD4UTFyCxs2Y5FN2Tb8QwYT8jAkPebpG52Ysd wnxfJIssSStNGeI5+x+PXRNgMGZK8If4FAnlIrh7je1/Ue+/X5Ku9WAT4ojnUTnBUwMC otA/djeqE8b/ACJ5SUTuxDmmhGqa0vxqEYQDusBxPpnE+Tyz0fj1/Qgr6kofxhxPrdl+ gsWw== 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=4Wky95+cp9t6Uc0O4qIN4Z6xGmvHn/NYIHDQjQIG07k=; b=fF8j5cGI78HqVV90u+M7EbgOvSfPzxxHCx559HE7u6TPvDErJaaC4+hFdtlw3nRp5W DRkApL2xL34xQ+5QL8a4PaZj2VyE5Z9mIs1Ag8xROkmP9XIMbsaoB1l//azS0ZA89Xgd PSQy7qU3jB0q6yxjRcckQD6RgyK9QK8M+VsWe2wGubYB2eooYh2c6SWbPg3pU0ina6tD Jm7nzOpV02MpPq4gsgCcLa7zAH7DXOa2V/dtWxMnH+Eyi4O3pI1e0gZdwKS4qfcrePCO rZ/cyWwZzf9lYVP9MbkAo3tCtsn86eqFowBOqp9NJNdmMPLhoBeiVuLEZBpIkegimEbC xDkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=b0qtqXGs; 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 r25si339739eds.157.2020.08.27.06.06.34; Thu, 27 Aug 2020 06:06:57 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=b0qtqXGs; 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 S1726880AbgH0NEa (ORCPT + 99 others); Thu, 27 Aug 2020 09:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726971AbgH0NAH (ORCPT ); Thu, 27 Aug 2020 09:00:07 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80ECAC061264; Thu, 27 Aug 2020 06:00:07 -0700 (PDT) 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=4Wky95+cp9t6Uc0O4qIN4Z6xGmvHn/NYIHDQjQIG07k=; b=b0qtqXGspyLjHuQD/EC9RMu68r R4fF8h5wxyM0dri1npgOSvdmAI/vTKaEGhRhGKIrKQsm7aXqeN9M/UQ2CnRm04AYEzZVa3InvywX7 5f8OAOsZcoB7dBqYf7rax9NJJ5xzMQmikW+Ac6/+magIzfZJxDzbUjykY06V4w4GJ/Ui4XIEr8TRk GU6JX3PMGMkRr2HkVT+SpoitNA3ZB9usoyi4IMxXcUgYV408ZEfevURTjgH8kr/n9GiB3y9XsSVbS 8zT0raF2qOSRpWk3ZVrteE0+kcDtbDRp+QLBtSHGg6QIfJNfA69Pet3xluPeLDchpOtD1B9/0WEcK cZJ/zZiQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kBHVF-00043a-G7; Thu, 27 Aug 2020 12:59:41 +0000 Date: Thu, 27 Aug 2020 13:59:41 +0100 From: Matthew Wilcox To: Johannes Weiner Cc: linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , Jani Nikula , Alexey Dobriyan , Chris Wilson , Matthew Auld , Huang Ying , intel-gfx@lists.freedesktop.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/8] mm: Use find_get_swap_page in memcontrol Message-ID: <20200827125941.GG14765@casper.infradead.org> References: <20200819184850.24779-1-willy@infradead.org> <20200819184850.24779-3-willy@infradead.org> <20200826142002.GA988805@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200826142002.GA988805@cmpxchg.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2020 at 10:20:02AM -0400, Johannes Weiner wrote: > The refactor makes sense to me, but the name is confusing. We're not > looking for a swap page, we're primarily looking for a file page in > the page cache mapping that's handed in. Only in the special case > where it's a shmem mapping and there is a swap entry do we consult the > auxiliary swap cache. > > How about find_get_page_or_swapcache()? find_get_page_shmemswap()? > Maybe you have a better idea. It's a fairly specialized operation that > isn't widely used, so a longer name isn't a bad thing IMO. Got it. find_get_incore_page(). I was going to go with inmem, but that it matches mincore sold me on it. /** * find_get_incore_page - Find and get a page from the page or swap caches. * @mapping: The address_space to search. * @index: The page cache index. * * This differs from find_get_page() in that it will also look for the * page in the swap cache. * * Return: The found page or %NULL. */ I was focusing too much on what the function did, not why it was doing it.