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=-6.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 89B6FC07E99 for ; Thu, 8 Jul 2021 07:30:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3840761CDF for ; Thu, 8 Jul 2021 07:30:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3840761CDF Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 122DD6B0011; Thu, 8 Jul 2021 03:30:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D3A16B005D; Thu, 8 Jul 2021 03:30:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB5EA6B006C; Thu, 8 Jul 2021 03:30:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id C7B166B0011 for ; Thu, 8 Jul 2021 03:30:40 -0400 (EDT) Received: from smtpin39.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 1D9B618392610 for ; Thu, 8 Jul 2021 07:30:40 +0000 (UTC) X-FDA: 78338598240.39.4466E00 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf26.hostedemail.com (Postfix) with ESMTP id 9706E20019C0 for ; Thu, 8 Jul 2021 07:30:39 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 77047221B3; Thu, 8 Jul 2021 07:30:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1625729438; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UvKBtgDJJSvlazZoG9eWIlUCoPkN8k51/u56BNq97QA=; b=e3NA9Gbqhh1KgJD/k0FA7D0KbLNdk+DuIe0uUjHTG+JxKpT2mjM7o4OR9QUuoZpS2gfLh4 lALnC8eJEe2lALJA20VVWRweaGIJ9qQwXXv/AUXOHHYcmhxv1wrjqtD+USw7cXjQH1UhbB 6ine6M03QXi51lHvBOP5Nev0b8sGuSc= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 47447A3B84; Thu, 8 Jul 2021 07:30:38 +0000 (UTC) Date: Thu, 8 Jul 2021 09:30:37 +0200 From: Michal Hocko To: Matthew Wilcox 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: X-Rspam-User: nil Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=e3NA9Gbq; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9706E20019C0 X-Stat-Signature: eh7e55j7rpdg1ssgsw7s1nmjq9pxgzr7 X-HE-Tag: 1625729439-504615 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 07-07-21 16:25:07, Matthew Wilcox wrote: > 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. Well, cases like this one shouldn't be really hard to explain though so I wouldn't be worried about this. -- Michal Hocko SUSE Labs