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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 126F0C433DB for ; Thu, 25 Feb 2021 03:56:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72FEF64E02 for ; Thu, 25 Feb 2021 03:56:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72FEF64E02 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BC9CC6B0006; Wed, 24 Feb 2021 22:56:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B7A616B006C; Wed, 24 Feb 2021 22:56:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A902A6B006E; Wed, 24 Feb 2021 22:56:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id 932CF6B0006 for ; Wed, 24 Feb 2021 22:56:44 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 5A51282F4063 for ; Thu, 25 Feb 2021 03:56:44 +0000 (UTC) X-FDA: 77855428728.11.AAC6356 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 84FD0132 for ; Thu, 25 Feb 2021 03:56:41 +0000 (UTC) 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=+VTPtIMpGcN6w4RmHgdNd6IeFShUVJwNrk2/joKyueI=; b=Ix980A7Htoh/OVX8qDJG1830M0 534uvDXukdDuARYmNGKRCsAPzCSY0/FaIZ7C9K3IFEX/87LZcG5yvzefbOVgc0Dxgo8HNHqI32pUO Y7Bqa9N4Od4d/Xnvtb6HRS+UHubyn83ex3t25iC0FCBQ6TvUTu4ZjAjw0Cs2R5/mwtwSXyBYu77R+ c3dl9eG05Oa6VBYWscUONyPBIBB2sAnVAStyKcCItwcvER9L5e2HXxHs42K76fFrTkligVOBmnWIo 1xen+66NsgqfNF47qGt8JtWfvXQNF8MmfBlzmeOqa/LGVgSXJOMGR+0L3gK4qjfZhu0WaTHQWUXlT 5JkjGxKQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lF7kn-00AEba-SP; Thu, 25 Feb 2021 03:55:58 +0000 Date: Thu, 25 Feb 2021 03:55:53 +0000 From: Matthew Wilcox To: Yu Zhao Cc: Andrew Morton , vbabka@suse.cz, alex.shi@linux.alibaba.com, guro@fb.com, hannes@cmpxchg.org, hughd@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, mhocko@kernel.org, vdavydov.dev@gmail.com Subject: Re: [PATCH] mm: test page->flags directly in page_lru() Message-ID: <20210225035553.GX2858050@casper.infradead.org> References: <20210122220600.906146-11-yuzhao@google.com> <20210224084807.2179942-1-yuzhao@google.com> <20210224051558.79e31c60eea2c088f4a1b300@linux-foundation.org> <20210224215639.GT2858050@casper.infradead.org> <20210224224846.GU2858050@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: r73djq4tzjiatsxe5zush64aszos4qa3 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 84FD0132 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614225401-172246 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 Wed, Feb 24, 2021 at 04:50:39PM -0700, Yu Zhao wrote: > On Wed, Feb 24, 2021 at 10:48:46PM +0000, Matthew Wilcox wrote: > > On Wed, Feb 24, 2021 at 03:34:16PM -0700, Yu Zhao wrote: > > > > If only somebody were working on a patch series to get rid of > > > > all those calls to compound_head()! Some reviews on > > > > https://lore.kernel.org/linux-mm/20210128070404.1922318-2-willy@infradead.org/ > > > > would be nice. > > > > > > I'm on board with the idea and have done some research in this > > > direction. We've found that the ideal *anon* page size for Chrome OS > > > is not 4KB or 2MB, but 32KB. I hope we could leverage the folio to > > > support flexible anon page size to reduce the number of page faults > > > (vs 4KB) or internal fragmentation (vs 2MB). > > > > > > That being said, it seems to me this is a long term plan and right > > > now we need something smaller. So if you don't mind, I'll just go > > > ahead and remove compound_head() from Page{LRU,Active,Unevictable, > > > SwapBacked} first? > > > > It's really not a big change I'm suggesting here. You need > > https://lore.kernel.org/linux-mm/20210128070404.1922318-2-willy@infradead.org/ > > https://lore.kernel.org/linux-mm/20210128070404.1922318-5-willy@infradead.org/ > > https://lore.kernel.org/linux-mm/20210128070404.1922318-8-willy@infradead.org/ > > and then the patch I sent above to create folio_lru(). > > > > Then any changes you want to make to use folios more broadly will > > incrementally move us towards your goal of 32kB anon pages. > > Well, these patches introduce a new concept which I'm on board with. It's not really a new concept ... it's a new type for an existing concept (a head page). > Assume everybody else is too, it still seems to me it's an overkill > to employee folio to just get rid of unnecessary compound_head() > in page_lru() -- this is not a criticism but a compliment. It's not overkill, that really is the point of a folio! If you think about it, only head pages can be on the LRU list (because the compound_head is in the union with the lru list_head). So it always makes sense to talk about folios on the LRU list. > Let me work out something *conceptually* smaller first, and if you > think folio is absolutely more suitable even for this specific issue, > I'll go review and test the four patches you listed. Sounds good? Umm. It seems to me that no matter what you do, it'll be equivalent to this, only without the type-safety?