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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 53AFFC433E0 for ; Wed, 24 Feb 2021 23:50:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 61CBA64F0F for ; Wed, 24 Feb 2021 23:50:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61CBA64F0F Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B69546B0005; Wed, 24 Feb 2021 18:50:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B1B126B006C; Wed, 24 Feb 2021 18:50:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0B696B006E; Wed, 24 Feb 2021 18:50:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 8929B6B0005 for ; Wed, 24 Feb 2021 18:50:47 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 59344F045 for ; Wed, 24 Feb 2021 23:50:47 +0000 (UTC) X-FDA: 77854808934.24.F67FC63 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by imf18.hostedemail.com (Postfix) with ESMTP id 5663E20001EA for ; Wed, 24 Feb 2021 23:50:48 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id 81so314086iou.11 for ; Wed, 24 Feb 2021 15:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HHAMxwO0RN5Il90ir5Bo3fGze6LKQGtEHSeat0z2uIo=; b=cRo4toHeGxpVexHF/YAEG+uIWzAyWs1pK2mIlg962ut4/vVoLntcPQZC6JdtFf92zU oxIx+Ht1M/6QSNgA2r3AX1dDXz8MpQQz/PmYwze5GeydKZIi7V7NcH+ogPC1DCtzQ/0S +WXL8pZzow/0r5Z7THeNawXu1DpSqsGgzl/RhKoerkFM0/cTbArlm6qP5eq4Zw3Vfsoh 7txgTpuf0ogRJxJhRzuGsdiJlgs3qqkQInLSgRC7YlemI7P9CzSHS6tMMYaH882XuLuF yDxXOnuWZeD62+EvMooff1tpbv6gy4lfZFFmUhRZ2rp2l8CsZUg1LiuFH352Jb2x0Ch6 VwBA== 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=HHAMxwO0RN5Il90ir5Bo3fGze6LKQGtEHSeat0z2uIo=; b=hpzJE8XDyjc2kz83aRF6ZsNmlcZLNUmN6mkSFmELDMCaIVvPtqhtfTPN4CrdNOtZQo BCQQrOG2aqaE/00ZrhMMfWJA5I1dpiswcPQPQOb88CuhatHpU0QNrq3x5q7BYwt2ApQl 7IohYAVUR45fD8ibKz9uaUSWkAmNX1xSF8XZr8EH+6DdzGykGAZ0y7iCGb1Q8Ndm7IlU SgmA2WewqUGCivhf72VkZQWkAulVI2GgpvvK3SPnA8XzGs+Ymta4cUzgiw1UY8VRDHiY XmWrIyIY+pA6TMIiLp7QLfiiDthJR8AAMChWVZYegB/XPCTStHYuRpxUdYPGICKGF1tR N7LQ== X-Gm-Message-State: AOAM533Atb99k0+Rv+dKm6WAboqdiqmm7iCSAtoQYgNsJXX33mX674mp af/ZSFggrGgXsLQuOE2efB0gfQ== X-Google-Smtp-Source: ABdhPJy6X/K39lgbmIovoZg4d8Uzw4vQJBZK8Vdk65weda6qzcWjI3+wRrtBRKSBq3o7hAr0ZAy/rg== X-Received: by 2002:a5d:9f4a:: with SMTP id u10mr310855iot.186.1614210646231; Wed, 24 Feb 2021 15:50:46 -0800 (PST) Received: from google.com ([2620:15c:183:200:c037:ba21:bf5e:4d1f]) by smtp.gmail.com with ESMTPSA id o8sm2248030ilu.55.2021.02.24.15.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 15:50:45 -0800 (PST) Date: Wed, 24 Feb 2021 16:50:39 -0700 From: Yu Zhao To: Matthew Wilcox 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: 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: <20210224224846.GU2858050@casper.infradead.org> X-Stat-Signature: 4yhumc1nfync8keftd7kbnn8g9185gsd X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5663E20001EA Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=mail-io1-f43.google.com; client-ip=209.85.166.43 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614210648-836093 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 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. 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. 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?