From patchwork Thu Oct 31 22:45:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kinsey Ho X-Patchwork-Id: 13858416 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 93A9FE6748C for ; Thu, 31 Oct 2024 22:46:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F8D16B0092; Thu, 31 Oct 2024 18:46:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A8E46B0095; Thu, 31 Oct 2024 18:46:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BECE6B0096; Thu, 31 Oct 2024 18:46:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E3C286B0092 for ; Thu, 31 Oct 2024 18:46:55 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6EBAD4037F for ; Thu, 31 Oct 2024 22:46:55 +0000 (UTC) X-FDA: 82735383150.26.C71272D Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) by imf21.hostedemail.com (Postfix) with ESMTP id 695B01C000F for ; Thu, 31 Oct 2024 22:46:01 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=2asbR34i; spf=pass (imf21.hostedemail.com: domain of 33AgkZwgKCL0nlqvh1krjrrjoh.frpolqx0-ppnydfn.ruj@flex--kinseyho.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=33AgkZwgKCL0nlqvh1krjrrjoh.frpolqx0-ppnydfn.ruj@flex--kinseyho.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730414768; 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-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=wWNqofTpO3McnA/xoHsMP4AewEwxFw4lNZTCusoRC/Q=; b=1pokOIS0CKKbf7TBGBhJbbZLgW6d00O3dYdB6QCCpesOPygypie1YQ6dMwrODWwvGtYrvH Eoo8ZuRRFh8TyeBKHScS/OJBqtsUn3rasVCXnm/onRDvez51pZtZ4O+Kgz4TXzulDL6yno tdxvhy+fJEzSDMJ4Vj2iZOtRvNGAc0o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730414768; a=rsa-sha256; cv=none; b=gLje37QgrKCJiJO+Dg6CjwOTJu6QWq7IcMud/HvMSy0G0AiJCCV7KQDdnYXJ8Iocmy97Si t4pT/p1O1UyE+zBPQsQzpV+JLQtWhqtwoX+pBgeVYpL/bTydv6dSL3ivlg3Q3EKh/6ECEe leFYaFNSFtdYNVdg4vabbXqJItwCalY= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=2asbR34i; spf=pass (imf21.hostedemail.com: domain of 33AgkZwgKCL0nlqvh1krjrrjoh.frpolqx0-ppnydfn.ruj@flex--kinseyho.bounces.google.com designates 209.85.216.74 as permitted sender) smtp.mailfrom=33AgkZwgKCL0nlqvh1krjrrjoh.frpolqx0-ppnydfn.ruj@flex--kinseyho.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2e59d872d09so1834913a91.0 for ; Thu, 31 Oct 2024 15:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1730414812; x=1731019612; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=wWNqofTpO3McnA/xoHsMP4AewEwxFw4lNZTCusoRC/Q=; b=2asbR34iqT7UWUmBAxvEOShZDKzeSAufG2NbuPOhh56Zw+I3zJOitluERrJeKtJ0pT XdqZOdprZG3GiirVxNPJtkDCuguuBn9a9zJNyY/gTrulWs91ci8MpZE8nJfx2w8O08cQ ZeO5PU6Ko+MWGtIWxZiAAPMwpZEMKEYlWysBXJ8abChGPZLu02CmB/dYNUacwqnzap3W V41Qoe9lb6fYA/7ogGlOyqH3pJMNilr+a1AYbNsFyj7uUPLqBnpzQGOCRN7VxRvZcRb3 JZsUmbhqOpk7AKOfXv4qrXNp+1JIWVS5DPLzj47ewy25YFyREzWfH6ippxM64k88YTUi +Zsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730414812; x=1731019612; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wWNqofTpO3McnA/xoHsMP4AewEwxFw4lNZTCusoRC/Q=; b=sf7o/kkCvA4PFqs1ugqpolNkJe1c3JZyZLINUlU9NvzfwhbU44j/Sq/UPMh80kbaIK pfSVxsVwPGSvjO+b76TZfZU4Cy7het9vhW/agf3MYzC9asbNX77/hMqbDws3paf1pY1x cSEEE7p3iWZ9HkpcEvMialQtt6u950cXx+Ir0aiEsulH+WhUaJ12/U/u5cdwAPVL/6Hy IwrBRzN8Y8cHkBtd/2JJ/DLR6BukY0vNo/x4fe4gvHIPBjY2DBk8rp25uxPS7OgCCl5Z bELGWHxcGT7spabPBhxX9zgQunAldmSdGKzKUIRV9KpI52tfMlrYSwM/M4FnyaU2qkSJ vX0Q== X-Forwarded-Encrypted: i=1; AJvYcCWhjWI151K/IOLYt3LPL0ZDUSmaYKAQNCPUJrDThG8nNBs5exSwenm+7Rn1K00TFVoGGNiOsHax4w==@kvack.org X-Gm-Message-State: AOJu0Yxan8e90dHnp2Sqa5sStWMZdKw/f+o/r+3FtLVpOFCV8A1xNBBW 4iBWrczqd9Z65ChnrPkzjenChujyZN8CAQWLuBwuwNlPM/Aj60qsZW8r/Db9nisnfcQGsgnd+lq O4mPS9aahDw== X-Google-Smtp-Source: AGHT+IGaJ2rgqbyyP31Xev0nRBvN2Idh0SQ5a+6516/dGsyioBAnn294ogITAzGgIXJXIh34+WTXqMYsm0jW5g== X-Received: from kinseyct.c.googlers.com ([fda3:e722:ac3:cc00:a1:836b:ac13:31a5]) (user=kinseyho job=sendgmr) by 2002:a17:90b:3e82:b0:2e9:4660:ac84 with SMTP id 98e67ed59e1d1-2e94c53ab03mr1455a91.8.1730414812264; Thu, 31 Oct 2024 15:46:52 -0700 (PDT) Date: Thu, 31 Oct 2024 22:45:49 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Message-ID: <20241031224551.1736113-1-kinseyho@google.com> Subject: [PATCH mm-unstable v1 0/2] Track pages allocated for struct From: Kinsey Ho To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Pasha Tatashin , David Rientjes , willy@infradead.org, Vlastimil Babka , David Hildenbrand , Kinsey Ho , Joel Granados , Kaiyang Zhao , Sourav Panda , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org X-Stat-Signature: ttgk9qqbqc348xoa9opwq8wtront43gi X-Rspam-User: X-Rspamd-Queue-Id: 695B01C000F X-Rspamd-Server: rspam02 X-HE-Tag: 1730414761-494320 X-HE-Meta: U2FsdGVkX19peQF38YO34Q3eqVCQwcLot8tanyNOGF7yHEoWYiaWsWzE0ss+ks3P7JJMnPJDnyxJ1DI9/3Q/1Y6cQJnJajI6UyO/SmXnWLftg37cZBw2eDsUMPvBg/iMthSrXtM5+IJXLwOB7zKpJQWNBpMtqbWEV8egFxATMDdaF2L9V35ibhGHTD3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zfANMwo/5m+3F3eUl5f6W+U0vzngKctbQw6kJGkGHRkDbY3h4npVlSfU9fD+FcEU8kToBtQr7xP+SUbgbHV0RAoN4tWLJVLWtCCexgez/KEswBs/IyZcezJTk0ElVMT15SW1VOt1pygtnRiYqHV5qof39rDo7ENVOvH8cgFRMNqyPApdgi4lfEqsUTfcdyA5ySrAMPrY8sQR/e7IT5J5bJvFcNhTUvtIT5a8Fz3b2xL6qG+NCM0DFnl6mTV4QzZkXJNh7pYvsuWRmW/RJ2HGz+or9s+0m99hV91mNcfBOmHTU4HjG4a X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: We noticed high overhead for pages allocated for struct swap_cgroup in our fleet. This patchset adds the number of pages allocated for struct swap_cgroup to vmstat. This can be a useful metric for identifying unneeded overhead on systems which configure swap. Before adding the new stat, Patch 1 introduces a generic system-wide counting interface. Kinsey Ho (2): mm: add generic system-wide page counters mm, swap: add pages allocated for struct swap_cgroup to vmstat include/linux/vmstat.h | 11 +++++++++++ mm/swap_cgroup.c | 3 +++ mm/vmstat.c | 35 ++++++++++++++++++++++++++--------- 3 files changed, 40 insertions(+), 9 deletions(-)