From patchwork Fri Aug 9 19:10:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 13759155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 753DCC3DA4A for ; Fri, 9 Aug 2024 19:10:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D42D46B008C; Fri, 9 Aug 2024 15:10:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA48F6B0092; Fri, 9 Aug 2024 15:10:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B46006B0095; Fri, 9 Aug 2024 15:10:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 954666B008C for ; Fri, 9 Aug 2024 15:10:27 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 308DD1613A5 for ; Fri, 9 Aug 2024 19:10:27 +0000 (UTC) X-FDA: 82433648094.18.924C2FD Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) by imf06.hostedemail.com (Postfix) with ESMTP id 50767180028 for ; Fri, 9 Aug 2024 19:10:25 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=Pf6OJ4y8; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723230560; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=o9iV2vbRkMRwI36Z4VJPdIDCj9RUg+36U4enIZc0tT8=; b=ujiqveLohiVG0PhS1hViV1sUorIQgC4qdcISYF7HanZi9SgFKkZ8EGMmtEBptrecaXKJJ0 T7wezjBZF6cO7tfhh7h32Tb+mveBXEJJTHnAboumOvjE61v6+vr5as6168NZ1JCzMeZKZk AJOOcyHO4ruoUkQs9DzRSLeubQnsgDA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723230560; a=rsa-sha256; cv=none; b=TraTXDCtr+53Y/cFjMqLFHtMgnt5xqO7u4NBQWwcfikfCyogWCw4RtdZnZtb0aN5QOMwx7 AcTAfCUeSpMplXh/0n4XsIDjKloV9P8xUqZyhBuDyhSIr0s3HVgpJlhicT2TA0mJG4PQzY h6DtjX7EDpIlbzBSlU3mmEpC+fSokpY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=soleen-com.20230601.gappssmtp.com header.s=20230601 header.b=Pf6OJ4y8; spf=pass (imf06.hostedemail.com: domain of pasha.tatashin@soleen.com designates 209.85.222.181 as permitted sender) smtp.mailfrom=pasha.tatashin@soleen.com; dmarc=pass (policy=none) header.from=soleen.com Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-7a1d42da3baso152627185a.1 for ; Fri, 09 Aug 2024 12:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen-com.20230601.gappssmtp.com; s=20230601; t=1723230624; x=1723835424; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=o9iV2vbRkMRwI36Z4VJPdIDCj9RUg+36U4enIZc0tT8=; b=Pf6OJ4y81pxStmuJgaTwQ0G3N7Re1y+hQ4LKkgzuzxTwpGkDT521xsYBjUgbb28iPN iOpD4ZqqE46FgJiKhUH1R2fZ5DxDen8GXlPuNmaxQoI0TxTmWv0vyzKOlh6+nJ8Z65TJ kxaWtGkU8+B/y9H2Yvsw3Zub44BIvWc/4sSIThkh+mYh1b6vNFlZnSMpVPdQjtcv/cZ1 uGiKcrHcnXR47+mV465aWJTLyjP14tOIAOZIF5HLYn2kkBKCVN1WwWg+AN8ZbNeYzOJm icHySBucRE9chiyT0snoHCTq8efu/xeQSrKaaH+Zt2Dg7WwJC7eaFQmc9VoACHUU+T4V /AWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723230624; x=1723835424; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=o9iV2vbRkMRwI36Z4VJPdIDCj9RUg+36U4enIZc0tT8=; b=wVpXjg3dn6DlecrhvzHQsAaqRNDAH7+KfX+rtiW1Ykr4qlfhf38GxiG5kitBPBkvws H4FhUvsRJFiCQxK47kGh/yqxQz8ImUPsOTwAiBCpalcJMdsemCJE1cftkb4m1pom1gEv jizji3kbQk6lXToe69IzeKBNaEJONoGtsvrrikwzSYSVY0FU5nzZeR0oEDXCiWNn+aS2 1NfLHVpmRKAcn2s9m7RfUwzcJsYdWG3TsbM6W+OedE7ksz8huTG4CMPx56U9MeMBkwUp NzQEj1faP8iJwqFcx+CA8hgHlesu0YqKBW51KYx0U4NRVOhuDNP/IvK3lPbJ45wO2EBc Wf1w== X-Forwarded-Encrypted: i=1; AJvYcCU1E69Y0DRpCbFmjq2NgDDzas+FB16V98F9d17OtVBknYDTx0XqtzUmO1f76M7a0g49tjLf6YEO4FWtzzN7CrF5u/E= X-Gm-Message-State: AOJu0YxbjW7NbPL2dlDh+PWhWkBu0iTnuGuhx7X6cNO9doAHilEjs3OA NuLkvv5vNEdfseG/XTR/dbPwKVUDoVW2lxnxFGsukysDVOpHhL5iPGvHXxkTHMw= X-Google-Smtp-Source: AGHT+IFg8hx8a43JYt48V2DzftFYWno8moyxBq05V1X3Uw/96SIO96frfXFhv6JTrc9ZbeZ0FeRecg== X-Received: by 2002:a05:620a:4045:b0:7a1:c431:3587 with SMTP id af79cd13be357-7a4c17def6dmr327493885a.32.1723230624200; Fri, 09 Aug 2024 12:10:24 -0700 (PDT) Received: from soleen.c.googlers.com.com (118.239.150.34.bc.googleusercontent.com. [34.150.239.118]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a4c7df5a55sm5522085a.86.2024.08.09.12.10.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Aug 2024 12:10:23 -0700 (PDT) From: Pasha Tatashin To: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-cxl@vger.kernel.org, cerasuolodomenico@gmail.com, hannes@cmpxchg.org, j.granados@samsung.com, lizhijian@fujitsu.com, muchun.song@linux.dev, nphamcs@gmail.com, pasha.tatashin@soleen.com, rientjes@google.com, rppt@kernel.org, souravpanda@google.com, vbabka@suse.cz, willy@infradead.org, dan.j.williams@intel.com, yi.zhang@redhat.com, alison.schofield@intel.com, david@redhat.com, yosryahmed@google.com Subject: [PATCH v5 0/3] Fixes for memmap accounting Date: Fri, 9 Aug 2024 19:10:17 +0000 Message-ID: <20240809191020.1142142-1-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.46.0.76.ge559c4bf1a-goog MIME-Version: 1.0 X-Rspamd-Queue-Id: 50767180028 X-Stat-Signature: hu8jeioa3p8zyr1tpnajasuebxctjqy1 X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1723230625-122500 X-HE-Meta: U2FsdGVkX1+7vQVhDgHC+M4jMHUvF9+tlA5FNiwGMRsIxfP4wtlw3KsNXVMe8Jvfpidj+an7wDMLgTVeqhJd1keWubPU+zuYdpzwxlLY5s4PMrZrbvk/vWkulrm9iFd0HkG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kWTiegxsrE8uJ0bO4SsD6/8AZ+MiCYpEzygZHc2gMm8GJ6BSL+EIx7j6OfkKXe4VV0uHtWm+VWm3F3OZ0cmInb1WQge0yz9Y4xZknChiSszbj6fAIQ+uPk0msAkPabFiFul4mdXFjInJOj2pveXAKCKUoUtdtwlK0jyi6pFiLCItkf1woqa/M/jJLCn6au2c/E8DrPo= 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: List-Subscribe: List-Unsubscribe: Memmap accounting provides us with observability of how much memory is used for per-page metadata: i.e. "struct page"'s and "struct page_ext". It also provides with information of how much was allocated using boot allocator (i.e. not part of MemTotal), and how much was allocated using buddy allocated (i.e. part of MemTotal). This small series fixes a few problems that were discovered with the original patch. Changes: - addressed a few nits from David Hildenbrand - added Acks, and Tested by's v4 https://lore.kernel.org/linux-mm/20240808213437.682006-1-pasha.tatashin@soleen.com Pasha Tatashin (3): mm: don't account memmap on failure mm: add system wide stats items category mm: don't account memmap per-node include/linux/mmzone.h | 2 -- include/linux/vmstat.h | 22 +++++++----------- mm/hugetlb_vmemmap.c | 13 ++++------- mm/mm_init.c | 3 +-- mm/page_alloc.c | 1 - mm/page_ext.c | 18 ++++----------- mm/sparse-vmemmap.c | 11 ++++----- mm/sparse.c | 5 ++-- mm/vmstat.c | 52 ++++++++++++++++++++---------------------- 9 files changed, 49 insertions(+), 78 deletions(-)