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 C803AC433DB for ; Fri, 26 Feb 2021 20:28:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9FB0564EFA for ; Fri, 26 Feb 2021 20:27:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FB0564EFA 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 1CFBF6B007E; Fri, 26 Feb 2021 15:27:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A60C8D0002; Fri, 26 Feb 2021 15:27:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E2B46B0081; Fri, 26 Feb 2021 15:27:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id EE1836B007E for ; Fri, 26 Feb 2021 15:27:58 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B3E1A8249980 for ; Fri, 26 Feb 2021 20:27:58 +0000 (UTC) X-FDA: 77861555436.06.CE69D23 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf01.hostedemail.com (Postfix) with ESMTP id 379152000388 for ; Fri, 26 Feb 2021 20:27:57 +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=wQi4bcARQ7gLU2OqClFICiAmMPFf5VMCacL0HPG2n1w=; b=Q2m92VFS6HI2HJw14kJKQAgBgB S0W5w58KIgzHfDVOXHRaxEIvKz8Nz+AJngwNXbytYupLecd/Den/y3KB84XYalFHxXI5dkjvdi9gn Q7exwHJ+sCb3TBVgq5CiLKCuFUij8TzEBRkx9n1rmI9k/EPQmJvxAQp4REN2FoVLN+bfzYlVUVzuO GqSLj6uFPJ6wrLyYa/TXQCnHXk+OCChzAjOkER9lpOF1OG+smrdgPokgI2y8X7Rwh12p3AfVTjsSt UDfhrt4UC5Vs6SZyLSppqmFUflkubv6qFdp1IQLcWxMoCrkUkPIPAVybpio9tpLIBE8qu0GUT0t4B 3+lyXKrw==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lFji6-00CTN4-GU; Fri, 26 Feb 2021 20:27:39 +0000 Date: Fri, 26 Feb 2021 20:27:38 +0000 From: Matthew Wilcox To: Yu Zhao Cc: akpm@linux-foundation.org, alex.shi@linux.alibaba.com, vbabka@suse.cz, 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 v2 3/3] mm: use PF_ONLY_HEAD for PG_active and PG_unevictable Message-ID: <20210226202738.GG2723601@casper.infradead.org> References: <20210224084807.2179942-1-yuzhao@google.com> <20210226091718.2927291-1-yuzhao@google.com> <20210226091718.2927291-4-yuzhao@google.com> <20210226121314.GB2723601@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: 8a6r95marbcff8cgty983ufwer7bzasc X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 379152000388 Received-SPF: none (infradead.org>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=casper.infradead.org; client-ip=90.155.50.34 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614371277-548213 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 Fri, Feb 26, 2021 at 12:49:41PM -0700, Yu Zhao wrote: > On Fri, Feb 26, 2021 at 12:13:14PM +0000, Matthew Wilcox wrote: > > On Fri, Feb 26, 2021 at 02:17:18AM -0700, Yu Zhao wrote: > > > All places but one test, set or clear PG_active and PG_unevictable on > > > small or head pages. Use compound_head() explicitly for that singleton > > > so the rest can rid of redundant compound_head(). > > > > How do you know it's only one place? I really wish you'd work with me > > on folios. They make the compiler prove that it's not a tail page. > > I hasn't been following the effort closely, so I'm rereading the very > first discussion "Are THPs the right model for the pagecache?" and > then I need to rewatch the recorded Zoom meeting. As I said I'm on > board with the idea, but I can't create a roadmap based on my current > rough understanding, unless you prefer me to just randomly throw some > reviewed-bys at your patches in the next few days. (Our long-term plan > for folios is to support arbitrary anon page sizes because anon memory > is more than 90% of total user memory on Android, Chrome OS and in our > data centers.) > > That said, if you have something ready to test, we could do it for you > in our runtime environments immediately. I don't have anything ready to test for anonymous memory; indeed I have no plans to work on anonymous memory myself. My focus is on the page cache. But, once we get the folio _concept_ into the kernel (ie a struct page which is definitely not a tail page), it can be used more widely than the page cache, and independently from anything I'm working on. The biggest risk is that we end up duplicating work ...