From patchwork Mon Jul 22 17:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Cassell X-Patchwork-Id: 13738975 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 B4C90C3DA59 for ; Mon, 22 Jul 2024 17:13:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 207CE6B0082; Mon, 22 Jul 2024 13:13:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 191926B0083; Mon, 22 Jul 2024 13:13:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 032586B0085; Mon, 22 Jul 2024 13:13:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D66186B0082 for ; Mon, 22 Jul 2024 13:13:24 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 45AC2161911 for ; Mon, 22 Jul 2024 17:13:24 +0000 (UTC) X-FDA: 82368034728.13.0A7D948 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 8E790160017 for ; Mon, 22 Jul 2024 17:13:22 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DRcX8D3N; spf=pass (imf08.hostedemail.com: domain of mcassell411@gmail.com designates 209.85.222.172 as permitted sender) smtp.mailfrom=mcassell411@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721668341; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=Vlzsr0aEbLd1fKawMEtWtodnCT2ftbY2wbZbcPg3z+o=; b=f8g1i+44MSfDsoQDhum4lnq5quezNJUTVE0dwMcNBtAeSg9B9DHg28xUJrBQxzJxbm65QI aibvXcSnM4ntoXLJDk3CTEbu4v5OnPOW+n68+BtiTy/4tsBX+q/lrQasO6GDr+o/YxSzCb XBVmMJiY2MpGyXdwJV0f6iNYThARrYw= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=DRcX8D3N; spf=pass (imf08.hostedemail.com: domain of mcassell411@gmail.com designates 209.85.222.172 as permitted sender) smtp.mailfrom=mcassell411@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721668341; a=rsa-sha256; cv=none; b=kz1oK+KOYQ+Bo45+G3Btj0nSKAbMPpOoFCCmO2L35Y/TUNWZaj993cRD86Enn8tJ+rqHdp V7cTtdAP4pBku+2r9mRzbtuL95s3xJ+P1Xn5a+vx64GrZqm+viyMQ8NG2ANkhawsRHwkWN JzKj1H0VGTzIskD4EWb3yEmW15t+J5Y= Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-79ef7635818so293146585a.3 for ; Mon, 22 Jul 2024 10:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721668401; x=1722273201; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Vlzsr0aEbLd1fKawMEtWtodnCT2ftbY2wbZbcPg3z+o=; b=DRcX8D3NjvSawgztXZFHBBlGTdX2IUaeSZELpXrdLm9PQ18N3akpR5eGj5dnigtj1y YjHLKwMd6tgCaLZ5z2OujhMgqgjo0ET961vcPbYkSFKeFkUQBUk7LmxgWwP4Gp67hwi1 gr4twUA+0imuOhFNyVuljCag9JgohkFQuYL8W3Z7qPFgNHsAc6ONzZnM/+Wm+uU9ZM1X ldXIBd82nP53BOvEsICZnF7xBXpp2dMDmgBNVdc9YHQekJu4EFW+ze8n1iiRoHH+1t31 2loaE/NVTo4nI9zDMgF6bJ8oy6+38b2Dqi/X+ulG2ihhfqSml604Hwmg5Cffo15t0SKy HfFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721668401; x=1722273201; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Vlzsr0aEbLd1fKawMEtWtodnCT2ftbY2wbZbcPg3z+o=; b=Cvs24JTAM2npoFMXcZkf/gnHRdB4AKQ5P9pRYIGr9Oz+3pwKcxQbv5i9c1uIards9n S0U1gp/W1TYwWfAioip6hek2e5znaJt7xBPROndcNdJFF0KPkQrGgVk+kqvrCathaOKZ 9JuQKkfDaRGzB788fhOp4DMDTOg+DezEH9Zwiny9KKzKvSTbo8BHAraH9JWoCG66vOGp PS26Cs6Jt8lSeV1YNQ8Y/1cgE/DFrx4/KeMJzAJSK8+IxcMeXcZpLCZ98aNfHndITO0k zVTgwy35G6nGEbdzJrHyl9n2tm+q+QGIQmjK8CNtOGUg87wDk+WydHZEMSrtydZ/apEa X3Fw== X-Gm-Message-State: AOJu0YzQjHe4DBgvi8aAQ6LSlh2wBX98/7OtKiQUhb37oDGjRtObItaQ 5gRwLyO7tRbOJ7AEYl62rjm5XDlVSXD01ff7RKMdweiwYxQOh6Og X-Google-Smtp-Source: AGHT+IH1EYMuImUaaSOSyOxBBdptY9FAWLJJVmqrQNQzezWal6sQSa4zscGVinuGNYJlPPUK4P/1mw== X-Received: by 2002:a05:620a:4714:b0:79f:4f3:88f5 with SMTP id af79cd13be357-7a1c06c5ba6mr65352285a.15.1721668401440; Mon, 22 Jul 2024 10:13:21 -0700 (PDT) Received: from localhost.localdomain (syn-024-171-058-032.res.spectrum.com. [24.171.58.32]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a199078357sm377571085a.107.2024.07.22.10.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 10:13:20 -0700 (PDT) From: Matthew Cassell To: akpm@linux-foundation.org, yosryahmed@google.com, cerasuolodomenico@gmail.com, lizhijian@fujitsu.com, ying.huang@intel.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mcassell411@gmail.com Subject: [PATCH] mm: added node_reclaim successes to VM event counters Date: Mon, 22 Jul 2024 17:13:16 +0000 Message-Id: <20240722171316.7517-1-mcassell411@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8E790160017 X-Stat-Signature: aizkn3md5e8xgxhuymh3whrp5m5oyics X-Rspam-User: X-HE-Tag: 1721668402-529409 X-HE-Meta: U2FsdGVkX180OHQtSLnEB9sdvOs4G0nQWV54OoUTNUkkb6lZVYQ3GI23YaZH9YhdMQVNdQN9yx8hk3B1ozZnHB5RWCefXRLnm44umZGcaz/v18pOLdBSobg8DfpK2wEiYRKMjZvPacnh1/N1sbkSk/jEfgdUStU8NZcdUd8kbwVdsv3WhHNMwGHF01jEVjFIY//GhvqfXyKVM93rXM7oKpSTSmgDMfStHE8XgI6fcNrwTZzrswKlBq6smfY/sxz9XuvLLNDaX82HICX1yc7wo6Xp/8znz4bdqc8o7d/rCpF7r16iBLRLrUBCEiSOC3eF20YzX3XV3KeZnTftSFr9WdanbacGngygPf1ycnOTscVTvmJpgvPPaVGsKOvTvVenoL7YjhDfhYmyjE5fyu+P5u4FVp7wQvk7iEZy4EBZg65tpiksDfY6g6YGHWY7r+EHPEKFbn3/asaHEBhVE/mGPrJ4weya+9y/orNLw4jfeFNu3od+UgJACvCd9R6rT3JPLFbOW0SaRNDLE/2Yo8gInsqSR/JXVmZe4hSXQmnHByXfQEaLWs0RLiXe6XjI8G4nQUcwB1ZmOgba38Wc6Drn8a9nP9fYJ7LgXwojVpCMw9JT68nfd0fMyPQPcAiIwzsZlLb6lbkWmfbvbjy4waiYD1n84HKwUgzMKL6vJFq72Mu6S6WTXm8I+nVOQDO+zGxRxEKMS5+GGhSL/CHL8liQ0hax9XrFdfWlBS8Vldz3jxh1Li1nfi1Nu5YZg8wvFgMZfgGksfP8s/oVhkvLD+jUiZzN5b27w/6Qwndx1nvP97aZHiSDVCZJV9awM7SaJ4LUYd0pbDRRqsBwG70dSgvpr2seccCwvdKpgsIuNVOnBmI6EnwsmOuRB5dUl1Jp8uu4Pnj8QeaYLVI2eDW4iVpGklcE09bcq1X6cbLNgyXcPbPVPFiQIdlsGNDlhxFH7UPf9Q7kWohj02w8upluJH+ lolXcRuC 42TWLahz2MgdB6+KwfNnoqu5XXw0/X1D0j0eQqoW0L55p2wG5Jt69WYiVKHH/IpOsOhVJI2i0QUpMfW2Silw35jhGIP4OpTlnixnT9KaHfNWeODeU8VWIGilVG4FFUkXW1Aj3KF94jfZGQAhAAzEchqgJGW8l4t37Cldya1pwIoIVB0NtvzH78yNXqb/3Mz2S+ez8Qamsx+IX/X8CkJZIaU9bHi87WMt8+owKFM0J6vZYiJhR43n+QlKhYsCQCYnBz3bwuJhSZwVtC17KvRY0yIBCrULpIV61zOo6bFMfFnOeuFMqk2NTLxh3CRQGAZFPATinlXi/9Icrlym80xaQTR43qMQgPc5CCdFNDgJa3gUB0lfDUqg7m2eDVnoczVI3uHJzR7gXo3YAL6s= 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: /proc/vmstat currently shows the number of node_reclaim() failures when vm.zone_reclaim_mode is set appropriately. It would be convenient to have the number of successes right next to zone_reclaim_failed (similar to compaction and migration). While just a trivially addition to the vmstat file. It was helpful during benchmarking to not have to probe node_reclaim() to observe the success/failure ratio. Signed-off-by: Matthew Cassell --- include/linux/vm_event_item.h | 1 + mm/vmscan.c | 4 +++- mm/vmstat.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 747943bc8cc2..6fff8ed3b1fd 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -50,6 +50,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGSTEAL_ANON, PGSTEAL_FILE, #ifdef CONFIG_NUMA + PGSCAN_ZONE_RECLAIM_SUCCESS, PGSCAN_ZONE_RECLAIM_FAILED, #endif PGINODESTEAL, SLABS_SCANNED, KSWAPD_INODESTEAL, diff --git a/mm/vmscan.c b/mm/vmscan.c index 2e34de9cd0d4..321f259d713a 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -7496,7 +7496,9 @@ int node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned int order) ret = __node_reclaim(pgdat, gfp_mask, order); clear_bit(PGDAT_RECLAIM_LOCKED, &pgdat->flags); - if (!ret) + if (ret) + count_vm_event(PGSCAN_ZONE_RECLAIM_SUCCESS); + else count_vm_event(PGSCAN_ZONE_RECLAIM_FAILED); return ret; diff --git a/mm/vmstat.c b/mm/vmstat.c index 8507c497218b..27e02b188da8 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1295,6 +1295,7 @@ const char * const vmstat_text[] = { "pgsteal_file", #ifdef CONFIG_NUMA + "zone_reclaim_success", "zone_reclaim_failed", #endif "pginodesteal",