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 37848C07E95 for ; Wed, 7 Jul 2021 15:25:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AAB0E619FE for ; Wed, 7 Jul 2021 15:25:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAB0E619FE 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 8C3756B0036; Wed, 7 Jul 2021 11:25:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8745F6B005D; Wed, 7 Jul 2021 11:25:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 715B76B006C; Wed, 7 Jul 2021 11:25:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 518796B0036 for ; Wed, 7 Jul 2021 11:25:27 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B19FE828BE8E for ; Wed, 7 Jul 2021 15:25:26 +0000 (UTC) X-FDA: 78336165852.38.9C8770D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf27.hostedemail.com (Postfix) with ESMTP id 126A370000A9 for ; Wed, 7 Jul 2021 15:25:25 +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=+zsfdjVgnxMHynCmmkxrnBrhGlR05KkOhD40pFea5wU=; b=Z9ayHCnfITRQ1mdzMiod9N4wJN gkqu78BKwwH+WTEGKQBlvGfBqxkuiQtrk6O5m/hcpdFnUoaJ7+QIO0rihEDbbw6GIqdItItUW+pFz PU+N6hlENMCsFFhXmUzFlJAwqkpjwsjkky8OvTom7sNkmnz6P8S9JbjgSAOcJANQQZvuqq6RTzRDQ ZuYVH8UDXUNo875q7ASLMaIiPN5+GecbcQ9LYxtWHurgTQnnicgLpu8ihymPSVD3e9I1aImDT6pJF vqaIZ34Y8d/YEccLfC8cLa+ofuzNEUHpTwMU4X3OgET9hchOR+KahhkARtbIXYB/LVX8FfuqkY7s3 mF7kOJdg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m19QB-00CWal-PX; Wed, 07 Jul 2021 15:25:11 +0000 Date: Wed, 7 Jul 2021 16:25:07 +0100 From: Matthew Wilcox To: Michal Hocko Cc: linux-mm@kvack.org, cgroups@vger.kernel.org, Johannes Weiner , Vladimir Davydov Subject: Re: [PATCH v3 14/18] mm/memcg: Convert mem_cgroup_move_account() to use a folio Message-ID: References: <20210630040034.1155892-1-willy@infradead.org> <20210630040034.1155892-15-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Z9ayHCnf; spf=none (imf27.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 126A370000A9 X-Stat-Signature: wd6n7f6qt3pe8s9gnep5iqtuhqb1s4ae X-HE-Tag: 1625671525-648663 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, Jun 30, 2021 at 02:45:33PM +0200, Michal Hocko wrote: > On Wed 30-06-21 13:31:17, Matthew Wilcox wrote: > > On Wed, Jun 30, 2021 at 02:20:38PM +0200, Michal Hocko wrote: > > > On Wed 30-06-21 12:22:48, Matthew Wilcox wrote: > > > > We need to decide what 'NR_ANON_THPS' means in a folio-based world where > > > > we have folios of all orders. Does it count only the number of pages > > > > in folios >= HPAGE_PMD_SIZE? Or does it count the number of pages in > > > > folios > PAGE_SIZE? > > > > > > At this stage we only have PMD based, right? I believe it would be > > > simpler to stick with that at the moment and change that to a more > > > generic way along with other places which need updating. > > > > > > Wrt. counters they do count pages so in this case this shouldn't be a > > > problem. But we do have counters for pmd mappings and that might need > > > some care. > > > > Looking at how these are reported: > > > > show_val_kb(m, "AnonHugePages: ", > > global_node_page_state(NR_ANON_THPS)); > > show_val_kb(m, "ShmemHugePages: ", > > global_node_page_state(NR_SHMEM_THPS)); > > show_val_kb(m, "ShmemPmdMapped: ", > > global_node_page_state(NR_SHMEM_PMDMAPPED)); > > show_val_kb(m, "FileHugePages: ", > > global_node_page_state(NR_FILE_THPS)); > > show_val_kb(m, "FilePmdMapped: ", > > global_node_page_state(NR_FILE_PMDMAPPED)); > > > > it specifically refers to 'HugePages', so I think we need to only > > count folios with order >= PMD_ORDER. > > Why? The presented value is in kB. It gives us a cumulative number of > transparent large pages. Sure breakdown to respective orders would be > impossible in general but the same would be the case if order > PMD_ORDER. > > I am not really sure how useful that information is in practice but that > is a different story. The scenario I'm thinking about is a situation where we have gigabytes of memory in the page cache in 16k-64k chunks and we'll see FileHugePages: 5219348 kB FilePmdMapped: 0 kB which might cause the slightly-too-clever user to think there's a problem.