Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2926398rdb; Tue, 26 Dec 2023 09:27:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVrSgBZcQeQq2wfFSEcb6TtLtvvk7/QXWN5YHbRl7CMPWi2H2p7k9gW2dCYfaVHuTk93Cs X-Received: by 2002:a05:6359:6f87:b0:170:17eb:3790 with SMTP id tl7-20020a0563596f8700b0017017eb3790mr7134714rwb.56.1703611638140; Tue, 26 Dec 2023 09:27:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703611638; cv=none; d=google.com; s=arc-20160816; b=c3VKz2ve+DzNpuEoNg9hyqIYdrz2vPe5/tBxFAkwMZA0EImzOC2HvwfvrJ7kfyYZzE uX7Js/s5thehhESS6DqwxIvu1E6pjckTsyYcQotaNXFcKekJw3fhb9fniTZo85PTnfqH D7LyaZqhfMdXxchGnHccJfuJTsmyuTKQWEvseiyOFEIo1AV3rWi/lvMu3aNEdyNsC7OW S55CBvGH2W8F7bj4GclGeeN+VbYNYAuFpnRiQiaFTg78wG1ZPIYrGmrtKIpoXB2Rhkq0 Tdipt916BXsQuhyc2X2F1jHd6GBxY3PPc1X5GhYJ0Q1eqLoNhtOuwF9uZH4V2TwfxkCe yA8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=qF6xW1bdeiaI+KNkFjHq71eA86SN7AHEznnIaUPRnMI=; fh=7M1KZdX/j1od4qT3ntyC/lZUWwFRUj4XugbUrOfXvbM=; b=XQ3+tsaYA3MblewKNxQIZ9puGk3/vsweJMEETyryTSzzbf/FQsUo8Z2g7AvFgqJEe5 l7iamyjTmTJCuDvT5RGxNztwtnRDacfrFM9jrDvtuo10mzvEkUkaQ+DH4TxETnwp2Vfb W/fKSEWpB7/UtVO79qO9yNj91AhBfptUjq/WCCbFDBSScZXuyX0yg1CYNWCVXW2SKrUW fMaTMpDhwG8fxKXFDM3Muf0zJ0H87sZlyQe4sdBrzjHPpgP3sED6N0Rk+UvwsUxOTct4 AuGyHiCicqhAK55Qs1LXOatjyOYp82ByYF8IhqBCONVWojF+8o1Cz48ucNBEhbWghPaR YO8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=NANZXvQs; spf=pass (google.com: domain of linux-kernel+bounces-11594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11594-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id jw11-20020a170903278b00b001d3ad3ec267si9774531plb.376.2023.12.26.09.27.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 09:27:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=NANZXvQs; spf=pass (google.com: domain of linux-kernel+bounces-11594-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11594-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8713CB21CD1 for ; Tue, 26 Dec 2023 17:27:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D1564F8A9; Tue, 26 Dec 2023 17:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="NANZXvQs" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73B574F880 for ; Tue, 26 Dec 2023 17:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=soleen.com Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-4277e7146abso42815991cf.1 for ; Tue, 26 Dec 2023 09:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; t=1703611624; x=1704216424; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qF6xW1bdeiaI+KNkFjHq71eA86SN7AHEznnIaUPRnMI=; b=NANZXvQs76I4zfIEF/R/Gv4JxV+OmPnaFxBTbtf4hRuJ57nKFXpVMmMBLf+3/lri1U M2leRqU+B9ICxcaFWlc0oClARdpEr9Y4NDGxzMnB313EoyHQ4BOaqAFqr6jGh9tFO0Qf 3agpfcgIl1y5J834dQO0w7OdSAdMnOO+1BW+1DN1XExLnQ1786VaCa2Tgh80/Db6gqvO w9bayRvvJuRDQI+C5UVnIOnFxmRtz8nASIMFQzB/zRCYbFw8K7+J8MGGxnlPsrr8dffS rxyXRZ8V0joY2TsPfOWzW4UaPtxAeRNmWj0J/9j6wwEepwtRserDEnny+tibIuV3G7IN /4MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703611624; x=1704216424; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qF6xW1bdeiaI+KNkFjHq71eA86SN7AHEznnIaUPRnMI=; b=PrWFvZEI8EnLnvRwCE/avO4oPvu25H9iAjRYcC5UZbqIbzED1Ukoiit3Jzp4ZD5g26 qc3LtGq7n5F6N5NjKa/5as0xklz8R3+q0iQTEgGfwpmKKPMVDzfrgJEeA0KaQhJNcYuq 0iKc9XcKgdxMdpVi+34FEaicmQ7s7UpDrJNQ692ahyQ4LOmg6ExcEO4ac0MHG4WA5kr+ zera9eFtzODe+9eVcffUndDoDgcQLMyjd3DAEgOCNLFrmFK28xLXg9TJGu5yHijqYn09 zTlauqGRqwlv74Fdf33B30qhwE/vT/CAdpsCH/r8CxMvlDcWQoDy3SfUYtkRKJWXhT/K VNGw== X-Gm-Message-State: AOJu0Ywr5rbh+nx3aeO8Egbjdn1aghHSmUJMGv6+cNhHIm5wFxxhlKts iWPumG2tQecMLEH9p9PsOzDDizEbkgahk1Nktn45cUJr1WPwBA== X-Received: by 2002:a05:622a:11d1:b0:427:a316:a26a with SMTP id n17-20020a05622a11d100b00427a316a26amr11771992qtk.69.1703611624440; Tue, 26 Dec 2023 09:27:04 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231211154644.4103495-1-pasha.tatashin@soleen.com> <3d415ab4-e8c7-7e72-0379-952370612bdd@google.com> In-Reply-To: From: Pasha Tatashin Date: Tue, 26 Dec 2023 12:26:27 -0500 Message-ID: Subject: Re: [PATCH] vmstat: don't auto expand the sysfs files To: David Rientjes Cc: gregkh@linuxfoundation.org, rafael@kernel.org, akpm@linux-foundation.org, surenb@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, souravpanda@google.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Dec 24, 2023 at 4:26=E2=80=AFPM David Rientjes wrote: > > On Thu, 14 Dec 2023, Pasha Tatashin wrote: > > > > > Whenever a new fields are added one of the following: node_stat_ite= m > > > > numa_stat_item zone_stat_item, the /sys/devices/system/node/nodeX/v= mstat > > > > files are auto expanded. > > > > > > > > This is a problem, as sysfs files should be only one value per file= . > > > > > > Does this patch address the one-value-per-file issue? (I think that = ship > > > has sailed for vmstat.) > > > > That ship has sailed for vmstat, this patch addresses what was asked > > by GregKH: not to add new values to vmstat, as not to make the > > existing problem even worse. The sysfs file system has a one page > > limit per file. The developers will decide how to export the new items > > added to node_stat, numa_stat, zone_stat individually. Each new item > > can be exported in its own files, and must have its own documentation > > about interface stability, value meaning, and expectations when the > > stat file is absent. > > > > As of at least 6.5, /proc/vmstat is a strict superset of the per-node > vmstat. Why is that a problem? The intent of this series is to stop auto expanding /sys/devices/system/node/nodeX/vmstat as sysfs should only be one value per file, and the task is not to make things worse. /proc/vmstat is mostly ok, however we might not need to auto expand it as well, to avoid situations where removing a field becomes a problem, and we have to keep it in the file forever, like what we do with nr_unstable. > There's great benefit to being able to use the sample implementations to > parse either /proc/vmstat *or* the per-node vmstat and without needing to > read the per-node vmstat plus some new set of sysfs files that are > one-value-per-file. The per-node vmstat will always be multiple values, > in fact it's a key value pair. Yes, but that file is already large, and soon can overflow a page size, instead of converting it to a binary format, let's add new items as one item per-file. > I have to think that doing anything else for vmstat is just adding > complexity (like this patch) and actually making it *harder* on userspace > to read the data it needs. > > Yes, the per-node vmstat likely shouldn't be in sysfs at all but it > appears to have been added there 13+ years ago because it was a convenien= t > place to add a per-node variant. That's not ideal, but owell. It is up-to GregKH who requested this change. Greg, specifically requested not to add new fields into per-node vmstat, and we are adding new fields with per-page metadata series, and IOMMU accounting series as these files are auto-expanded without this series. Pasha