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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74280C3DA6E for ; Thu, 28 Dec 2023 20:52:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1EF56B00FC; Thu, 28 Dec 2023 15:52:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ECE906B00FE; Thu, 28 Dec 2023 15:52:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC7C96B00FC; Thu, 28 Dec 2023 15:52:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CA7516B00FC for ; Thu, 28 Dec 2023 15:52:36 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 96EA21201E0 for ; Thu, 28 Dec 2023 20:52:36 +0000 (UTC) X-FDA: 81617425512.06.45FCB66 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf01.hostedemail.com (Postfix) with ESMTP id DD4E34000B for ; Thu, 28 Dec 2023 20:52:34 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="sOaiK/R/"; spf=pass (imf01.hostedemail.com: domain of rientjes@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=rientjes@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=1703796754; 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:in-reply-to:references:references:dkim-signature; bh=S788tp3IyJJGZzIwxLHgTA4XtDw+UIahU/ujGgekUjs=; b=Fou3AQfZz6CpF3NDk1c9zCgEQhjmfAkbyUU5rZlJdAJc9WWcPrT4tC7R6GmFKfc8alSoa8 EeWJ0dTmFSGPF8p4Nt4zxIXd6349ejF/8XvL/ZClCmnW5lMpPpp9nEcmS6zn+HW+JW5m/a aveGAvdQj08++/RcQwdMuaBf2bgWYPo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703796754; a=rsa-sha256; cv=none; b=zM1qzWtWq2hzowBSpsimDWRn9yV2qejxTmTFX7+JOZ+74RcNU14NMKWHnKT4cNQSyl3Agj py8ZC6wd2dlQt/kfeJosUQYqIpN2MX7muFXIX9lpqTeT186tn4xDr7EiaGNiH6Py2WgIXa vA0Hb4REATL08fbXTsrgmnDy2bEq0Ds= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b="sOaiK/R/"; spf=pass (imf01.hostedemail.com: domain of rientjes@google.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=rientjes@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d47fae33e0so251375ad.0 for ; Thu, 28 Dec 2023 12:52:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703796754; x=1704401554; darn=kvack.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=S788tp3IyJJGZzIwxLHgTA4XtDw+UIahU/ujGgekUjs=; b=sOaiK/R/VM+fMhbCUhFTBOo3agZcJqMAhdV9NRckJlyqE1cE25+8ze7GnDwRDPPusk z+68sxSKoRWGyQsBZda4M/xLcToBRp9I+iCz9Relx/gi+KCRn9mSNWNt07oF9b/UMwdQ CvocJ+oGCp1oVJBbjKv4l9A/ZIa+3BRI2gAoBjZOCgAC+rjbn7BpzbJbfuv5h3XrqbEn aOFzQt7w3/zFzZ2Y+UyNntpmvLwFXrGq+N+mdbgxIAgO1q6VaBhsJQj4bZuxiBr1IosM zR9c/OxgqJOM0mEqcp31NP9LL+tCexbv197tgPP+cQ1VdbgHWr/TkF84e6tF2f8CrvVK FBnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703796754; x=1704401554; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S788tp3IyJJGZzIwxLHgTA4XtDw+UIahU/ujGgekUjs=; b=N2WpTfME0rJyzYOZ9msUpA0arQFBMe5WNvLdwVve2dWubsreBsfLJhuywIAoG5JoH6 UyvaKgsxfYKWFsiJY2XIdV1qL4vZ7GxD14OiQq2JoSCt225mAfGWRILSzmykICeL40K5 TZZCebLWpdBADQadCdTttpqbkloSUjUXi+/ETJOszbIhRVGkS4ZlLgHj/fcQ2eI4LSuJ RZjbArR1xHmImXRL84YjbqZlWsAA4k5w8xUEpTkSmBz9TV2QOaVVcscQWqitKzi6Lasx z61449PYsiJUcG08GhLQpm22QjNxqWG/cy8x+BfALxWLeVUggfQC6hRvpnLpEz7y/8uD yJfQ== X-Gm-Message-State: AOJu0YxaJbzr+wnzI2ZgdNKmyNujMlo0/m6o6dskM+shsZ5wk0upo0Ie VsiMt4WfSa/hbCtabuybpxFvi2GEh2yf X-Google-Smtp-Source: AGHT+IGlbqQLYbN6grmwp2KQNqREMnkwdmeje4MbNj3wZpkS6osclrkD9IvJ/FUiRZL1Hu3H0NWZtQ== X-Received: by 2002:a17:902:ce85:b0:1d0:a45c:202 with SMTP id f5-20020a170902ce8500b001d0a45c0202mr771128plg.24.1703796753327; Thu, 28 Dec 2023 12:52:33 -0800 (PST) Received: from [2620:0:1008:15:5eb6:dfb2:ff4b:8b64] ([2620:0:1008:15:5eb6:dfb2:ff4b:8b64]) by smtp.gmail.com with ESMTPSA id ju22-20020a170903429600b001d1cd7e4acesm14344261plb.68.2023.12.28.12.52.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 12:52:32 -0800 (PST) Date: Thu, 28 Dec 2023 12:52:32 -0800 (PST) From: David Rientjes To: Greg Kroah-Hartman cc: Pasha Tatashin , Linus Torvalds , rafael@kernel.org, Andrew Morton , surenb@google.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, souravpanda@google.com Subject: Re: Sysfs one-value-per-file (was Re: [PATCH] vmstat: don't auto expand the sysfs files) In-Reply-To: <2023122824-washout-shrubs-1d6d@gregkh> Message-ID: <829410ca-1454-968e-b724-0ef0bfbca5cc@google.com> References: <20231211154644.4103495-1-pasha.tatashin@soleen.com> <3d415ab4-e8c7-7e72-0379-952370612bdd@google.com> <13e5fbd4-d84d-faba-47f1-d0024d2c572d@google.com> <2023122824-washout-shrubs-1d6d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Stat-Signature: 9opfkrdwwex9s1q6h7dfzrrbs8hf6fhe X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: DD4E34000B X-Rspam-User: X-HE-Tag: 1703796754-72666 X-HE-Meta: U2FsdGVkX1+aeSi8//j+yrrWMMSOyJoT1G91zgkTj/Jtw7sZzA99WZA1uofABbByzYU2ZXZ3fMrQIfsz7GzzNcu2Z+n5CiOutcKo4JWBGgx5hS0YXIPEwe9yndP8VrBTeR+mkSZEJYjtqXE73Axlr2Y+L6n75FZ+js+EoJ0dB1vOw4AZMl03xkvuH2Yt9wCopivDgF6dyKuDkBmgKgqSbkgOB+/CxI+C8yTVvlqynXQzuwjB0HP7i8C3GhXiI1qMMLCtmVJAZXxzdWAsuBi0qMMit2vowqzWbzD5p9FN8ml3q2RQiGsXjS3ZdYOafXRa9Yy+udjwoGC6r/CEOrjFUTqn27Zzpp/Kiu+2GwqOyhq+7QhVcaik7lsxvqOdQsHVxVcaGActaZ4Cn8EnS6tqIQJc+JXbnjXnk/lxTEGnK32hV5UsjiCoS0jEs6SL0/+rrpcwV3DSdFfcM50dmndLJw/4uSDgJrW2gB4kV81fDCfrqAE7PEKvA0iHpbAviAXu66AFDiYDEdwIi2egqB+V5K5+4muLXbWfcQH6936UkAFfcNdqXrdKfe9tOeoaJLRH1F1EEChV0sN3kxrPDzDV9DLSbp2oPzgODgG+zkkbSXEZjtAnmOblfdFvY1LMBL0brq2ocjbn4WBlCAECGWHGONg7gu1xSICquFvQB0Iq+XKpSoyaxYVUxKhi6/R7goZXvGFGyo3sVuZ2QFG+OvTHfKMlLsYQmataVMikjWJjcaGC8S/OuZw9NMkeYJvfy75hjsFTzKwxAaphWG25VSkqMeKP21DO3MXbSK+K1h12ZxwS5kltsxhPrWRO+mWIINnC83L1mwwnID6c+MPInJCluRl56gd2D8rRUNPIAVQanyvIAJzOty9qr9BT30R7EJhDfkfurrghEj+NOfYgx41Pt8VeGhn/2/zYPs+6f87z2Ifbm2xctLr1bM1Ugq9B5I5Nw6Oga/gbXYigXrkZqhd KBijL1P5 KNEfAeUptp/FZ7FhfLxVtJBcYcgDtZqkQhxdstZc9jRvGoO8JsQUyMVjkl4JK07RrjoAB2HjzKG7fFuBqtW4mMdaOqv8m6QbIsdcrJ4hji8+lGb2Us62FXi91ldGwChLQzROBBpT5xzHsMRHUhW+R4GSz9Kj9zqXcVgHX8Zhg4gVSEQHdBIe7dFV15oz+gHEP48yct9ZA+1k3U/VQii5TQ42quXtKgogyBr8m6rIAl/cw2u6DnnL1Y5RCu7HUSbOCWeNcVY2HCxK8uAA67B0IX5qRaiYcktzDPKaDMDt8xtYMBnCqEpm/PaaN8IxGfZXmlWTnnOn+A8W1MW28AMCUq4o22takarEjj8mpgww5qvGxJWJvW04/ic8hi0+sFs6Q4U3eLWlNMko/LQ5miZEZVhyESg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000008, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 28 Dec 2023, Greg Kroah-Hartman wrote: > > I'd argue that the ship on the "sysfs one-value-per-file rule" has sailed > > for long-standing use cases where either (1) switching is just not > > possible or (2) switching would be an undue burden to the user. > > > > An example of (1) would be THP enablement and defrag options: > > > > $ grep . /sys/kernel/mm/transparent_hugepage/{defrag,enabled,shmem_enabled} > > /sys/kernel/mm/transparent_hugepage/defrag:always defer defer+madvise [madvise] never > > /sys/kernel/mm/transparent_hugepage/enabled:[always] madvise never > > /sys/kernel/mm/transparent_hugepage/shmem_enabled:always within_size advise [never] deny force > > > > This convention isn't going to change. We're not going to suddenly add a > > new enablement or defrag option that can only be set in a newly added > > file that is one-value-per-file. > > > > THP was obviously introduced before any sysfs "one-value-per-file rule" > > No, the rule has been there since "day one" for sysfs, this file snuck > in much later with no one noticing it against the "rules" and I've been > complaining about it every time someone tries to add a new field to it > that I notice. > Ah, gotcha, thanks. I had assumed that the push for one-value-per-file started after thp, and perhaps even because of thp :) I have to admit that whenever I log into a new server type one of the first things I do is $ cat /sys/devices/system/node/node*/distance and that table just makes intuitive sense. If we were to go back in time and reimplement that as one-value-per-file, I'd just assume that many userspace implementations would just need to read 64 different files to structure it into the same exact table. On the other hand, I have wished countless times that the thp settings would have actually been one-value-per-file from the start.