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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 B4E09C433E1 for ; Thu, 27 Aug 2020 14:23:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72A142177B for ; Thu, 27 Aug 2020 14:23:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="KPqGwrms" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72A142177B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F37016B0027; Thu, 27 Aug 2020 10:23:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EE6896B002A; Thu, 27 Aug 2020 10:23:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAE246B002C; Thu, 27 Aug 2020 10:23:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id C1DC96B0027 for ; Thu, 27 Aug 2020 10:23:56 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 730D533C4 for ; Thu, 27 Aug 2020 14:23:56 +0000 (UTC) X-FDA: 77196567672.30.kick55_590ee022706d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id 93959180B3AA7 for ; Thu, 27 Aug 2020 14:23:51 +0000 (UTC) X-HE-Tag: kick55_590ee022706d X-Filterd-Recvd-Size: 4656 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Aug 2020 14:23:49 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id y11so2668065qvl.4 for ; Thu, 27 Aug 2020 07:23:47 -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=BmSkU8kL1DJIMf//B6UvwY8ukjXeH0WHbYlFQli5/Kw=; b=KPqGwrmsmOIuf+JiWEW/k7gGWQ1y3K+MpxQ+GlJBR4JHV9vGFTTbjyFMl+FZ4Y0eR1 K2BXbisksDsJdOWmVO1uqUYQ2h1rz6x4zhmDciS7F7QXhAv9oK2efTTjrKFY2lV0MX2h m+NX4PEHBJLAtiNCQ+E62vD9YoMqRVe4nQ2rLdY2M6j+IN9GUIPk+F93i5PMufggiU+5 7qfQtxk5IGmbE2ZD7qvuDqJQO8zKxEiYo6gkbc90Yi69wGk+9eBBpz/JoSeL/G/aFyFt vrKHByeeVrxLF5cwGuOVUkygA2VuBjAX42oiZQSqxkRduIvG36gg5Hfhjg+H7Ukg95zP RpMg== 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=BmSkU8kL1DJIMf//B6UvwY8ukjXeH0WHbYlFQli5/Kw=; b=FkVhuki47CmCmfg6X6GBQNZ+irivL/jeAxDwPTt/7ILAzq6YInAvif+yAxGz7vV5mL 2SWaDaTyqMkzOtSXFVN5Tu4HJRbCga4nI4Uyogq3Vg615zmddAIQQAfpn/fJlQUk0IxV d1Bp3xM8YAQxSt3s2pulVezHwF8Gy1vabZvqVsFMFYSOpQMUANu8WaRfqfwen5bdjRxc 4dQJchtS+1RugSqmzZAfzvwQN+nsi4BeEryebpaI5D2I7CnMHWmoqi3gG22I7PF9skRB k3o1h35GTLV5nPYsWcL5Gipfm5zbj4OYEHBWf1XaNAKlr4whf5jlHrCDr7l21B4oFN70 oUeQ== X-Gm-Message-State: AOAM531zEUFGTxPVeeC84JwPLWu7FDGJhetuvMMIkmRbejuGyXhvixdX 8DE6GC71+pOyKUXJnyHrjbWn3zTEBg7IlA== X-Google-Smtp-Source: ABdhPJxeJ4y+twhjLH2tJgCPbWVuyl+hfRB8UMwjlhngOikJ6bWHbwUXxgZd/BLJ9LZT047bUSDjHg== X-Received: by 2002:a0c:ffa1:: with SMTP id d1mr19299175qvv.36.1598538226887; Thu, 27 Aug 2020 07:23:46 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:412a]) by smtp.gmail.com with ESMTPSA id l64sm1953780qkc.21.2020.08.27.07.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 07:23:46 -0700 (PDT) Date: Thu, 27 Aug 2020 10:22:29 -0400 From: Johannes Weiner To: Matthew Wilcox 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: <20200827142229.GB1002856@cmpxchg.org> References: <20200819184850.24779-1-willy@infradead.org> <20200819184850.24779-3-willy@infradead.org> <20200826142002.GA988805@cmpxchg.org> <20200827125941.GG14765@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200827125941.GG14765@casper.infradead.org> X-Rspamd-Queue-Id: 93959180B3AA7 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 Thu, Aug 27, 2020 at 01:59:41PM +0100, Matthew Wilcox wrote: > 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. > */ Nice work, that's perfect. > I was focusing too much on what the function did, not why it was doing it. Me too.