Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5387053imu; Sun, 20 Jan 2019 09:42:06 -0800 (PST) X-Google-Smtp-Source: ALg8bN7tCsIj53g/E976y10gcCyUG8qsZA1jPJr8YFilpyDjBYoYwUFY+NrBM9Bku5+MZLUslU8h X-Received: by 2002:a62:2082:: with SMTP id m2mr26446561pfj.163.1548006126367; Sun, 20 Jan 2019 09:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548006126; cv=none; d=google.com; s=arc-20160816; b=IkjYXE8CFFcuy34qUYRIQmwCgYIpk94tQFyGkJbG7kvUaGIRQXLwSOA5tt0Pu6I1ja QBqF9RipWLFxeFzjuRfuaKQz/Dl1WOyvcoq2DxKSRZg3eTi84Jl8MZxPbUlaHzZTsc0q ehhp8ll875WPs6R14FtmIofXZ67C8QEgFXT2m+asw8d3N5TzeVdAVrd6cV0fsArCmqT5 I2Mi0J8HzOVEGWZmf3VB+CSg8bVJUmvwfJ0mm1UnPOft2p44HXvcOA3FptIt5PdAgaii ciXC4kL33GgnGPMaC+k7ZV+j/tARTCh6NNTADHc4dexXK+V/chMlnlOwkXn0Ml3eCmAV UuTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Pcnoj7pa45Wz3+JzXxb/xUbfSIWH8Dej4RIwdQGQb6s=; b=SRCM0Sn8OaG42MOUq02swzmkNxDXwA9DUUaombHg8J6OVwczxDap16epHsv0ddHLlD dd06g/aEVoQAtGnHcU/QJzGkq9Wm7ymZ10ZsFZj/ispYbOaIpBzMwRxsT1q4JWeUURtH PBZev0cZZ11vcPtEedUeDYwBz7ehEY68M4BFmnKCcKAQQdOHCRH/mdkFkCXFxdlp59/k Vb4el/5bYEo3LByrkPiRk/zQ6tcbyU2/WHgWPKGaDeL2sf8Hux0cu4qtBdoIO+qz5xsD wc4S39Ns5C4xTA3lsEjwn7sDiHI2miS2tb4McXo9LAa0xafEec+K735g81BXa7tR9MOF /4Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=S6NDO72O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a81si10460016pfj.195.2019.01.20.09.41.36; Sun, 20 Jan 2019 09:42:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=S6NDO72O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbfATRe3 (ORCPT + 99 others); Sun, 20 Jan 2019 12:34:29 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:43551 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726772AbfATRe3 (ORCPT ); Sun, 20 Jan 2019 12:34:29 -0500 Received: by mail-ot1-f65.google.com with SMTP id a11so18637869otr.10 for ; Sun, 20 Jan 2019 09:34:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pcnoj7pa45Wz3+JzXxb/xUbfSIWH8Dej4RIwdQGQb6s=; b=S6NDO72OPUN3A5+D1rHhmZHFU6Zuty3wP9LxltLb6mV6RrznCHle0tiDM6s3sRCXem oAhAyf5ahyJ2Wttzf0DHEqV5FXM9ifqaUL/i7L8JuZ2M12rTCOfxSocTbqxCwLKj0hqc FCcC74Yqk08fovkC3fvnjUqZC6HkrIlwX8/vISY0YQfZB4xWUVxPdZowxyMk8WViqyMw juCeHBWf4uoA9ynFq3oit0U3d4uXYTQp9HutylG1lHruSR0OXaPWoXZ5hnr+wUpP8ojX d3Fg3MapeVyTdnuOYfv73EaGg+8shJnNaLjLruYoULWZR2HnzNkN9g0rb0d6boa0nFrK +mVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Pcnoj7pa45Wz3+JzXxb/xUbfSIWH8Dej4RIwdQGQb6s=; b=eiDkXedz2nqOrOaXkl+KXf/SlOLHdvn/80PgxKhgTPzrg9A538zjTp8piU2mdl8BMj 1HPQ25rzDXidAFXSk7riPsrDMDbHbPME8UVacT6QjVQkCaZ2JvCfYhI/Qoert309LsGm ExtVPj/IclrX7gqfvTl/6PCXYzGE0YpwtI2BFjh+zfmBbyct+7B57jOJC0/KB7Asvuu5 xHqyateY5h4vEhLj967qU8q+8GQUSaD8hk3QoVMdYPcSa7QS1uSpO5VvwoVPZ0/A5cI3 A5s3bxSipeofQAE8fw0FUGIC+cKDEZdCsfgGq5ehp1HVAU+I87oIfI8LquGVOKl+HuAt sQBQ== X-Gm-Message-State: AJcUukfMWNRkSfJp+rxrIAOzwSljhUy4Hr1fJtLfCV3DkBpElISK13uM IOk82KRkRQKxkz9F80MZWnLFVA0w0JlimxClQL0UMw== X-Received: by 2002:a9d:3a0a:: with SMTP id j10mr16883888otc.229.1548005667969; Sun, 20 Jan 2019 09:34:27 -0800 (PST) MIME-Version: 1.0 References: <20190116175804.30196-1-keith.busch@intel.com> <20190116175804.30196-6-keith.busch@intel.com> <20190119090129.GC10836@kroah.com> In-Reply-To: From: Dan Williams Date: Sun, 20 Jan 2019 09:34:15 -0800 Message-ID: Subject: Re: [PATCHv4 05/13] Documentation/ABI: Add new node sysfs attributes To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , Keith Busch , Linux Kernel Mailing List , ACPI Devel Maling List , Linux Memory Management List , Dave Hansen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 20, 2019 at 8:20 AM Rafael J. Wysocki wrote: > > On Sat, Jan 19, 2019 at 5:56 PM Dan Williams wrote: > > > > On Sat, Jan 19, 2019 at 1:01 AM Greg Kroah-Hartman > > wrote: > > > > > > On Fri, Jan 18, 2019 at 01:08:02PM -0800, Dan Williams wrote: > > > > On Thu, Jan 17, 2019 at 3:41 AM Rafael J. Wysocki wrote: > > > > > > > > > > On Wed, Jan 16, 2019 at 6:59 PM Keith Busch wrote: > > > > > > > > > > > > Add entries for memory initiator and target node class attributes. > > > > > > > > > > > > Signed-off-by: Keith Busch > > > > > > > > > > I would recommend combining this with the previous patch, as the way > > > > > it is now I need to look at two patches at the time. :-) > > > > > > > > > > > --- > > > > > > Documentation/ABI/stable/sysfs-devices-node | 25 ++++++++++++++++++++++++- > > > > > > 1 file changed, 24 insertions(+), 1 deletion(-) > > > > > > > > > > > > diff --git a/Documentation/ABI/stable/sysfs-devices-node b/Documentation/ABI/stable/sysfs-devices-node > > > > > > index 3e90e1f3bf0a..a9c47b4b0eee 100644 > > > > > > --- a/Documentation/ABI/stable/sysfs-devices-node > > > > > > +++ b/Documentation/ABI/stable/sysfs-devices-node > > > > > > @@ -90,4 +90,27 @@ Date: December 2009 > > > > > > Contact: Lee Schermerhorn > > > > > > Description: > > > > > > The node's huge page size control/query attributes. > > > > > > - See Documentation/admin-guide/mm/hugetlbpage.rst > > > > > > \ No newline at end of file > > > > > > + See Documentation/admin-guide/mm/hugetlbpage.rst > > > > > > + > > > > > > +What: /sys/devices/system/node/nodeX/classY/ > > > > > > +Date: December 2018 > > > > > > +Contact: Keith Busch > > > > > > +Description: > > > > > > + The node's relationship to other nodes for access class "Y". > > > > > > + > > > > > > +What: /sys/devices/system/node/nodeX/classY/initiator_nodelist > > > > > > +Date: December 2018 > > > > > > +Contact: Keith Busch > > > > > > +Description: > > > > > > + The node list of memory initiators that have class "Y" access > > > > > > + to this node's memory. CPUs and other memory initiators in > > > > > > + nodes not in the list accessing this node's memory may have > > > > > > + different performance. > > > > > > > > > > This does not follow the general "one value per file" rule of sysfs (I > > > > > know that there are other sysfs files with more than one value in > > > > > them, but it is better to follow this rule as long as that makes > > > > > sense). > > > > > > > > > > > + > > > > > > +What: /sys/devices/system/node/nodeX/classY/target_nodelist > > > > > > +Date: December 2018 > > > > > > +Contact: Keith Busch > > > > > > +Description: > > > > > > + The node list of memory targets that this initiator node has > > > > > > + class "Y" access. Memory accesses from this node to nodes not > > > > > > + in this list may have differet performance. > > > > > > -- > > > > > > > > > > Same here. > > > > > > > > > > And if you follow the recommendation given in the previous message > > > > > (add "initiators" and "targets" subdirs under "classX"), you won't > > > > > even need the two files above. > > > > > > > > This recommendation is in conflict with Greg's feedback about kobject > > > > usage. If these are just "vanity" subdirs I think it's better to have > > > > a multi-value sysfs file. This "list" style is already commonplace for > > > > the /sys/devices/system hierarchy. > > > > > > If you do a subdirectory "correctly" (i.e. a name for an attribute > > > group), that's fine. Just do not ever create a kobject just for a > > > subdir, that will mess up userspace. > > > > > > And I hate the "multi-value" sysfs files, where at all possible, please > > > do not copy past bad mistakes there. If you can make them individual > > > files, please do that, it makes it easier to maintain and code the > > > kernel for. > > > > I agree in general about multi-value sysfs, but in this case we're > > talking about a mask. Masks are a single value. That said I can get on > > board with calling what 'cpulist' does a design mistake (human > > readable mask), but otherwise switching to one file per item in the > > mask is a mess for userspace to consume. > > Can you please refer to my response to Keith? Ah, ok I missed the patch4 comments and was reading this one in isolation... which also bolsters your comment about squashing these two patches together. > If you have "initiators" and "targets" under "classX" and a list of > symlinks in each of them, I don't see any kind of a mess here. In this instance, I think having symlinks at all is "messy" vs just having a mask. Yes, you're right, if we have the proposed symlinks from patch4 there is no need for these _nodelist attributes, and those symlinks would be better under "initiator" and "target" directories. However, I'm arguing going the other way, just have the 2 mask attributes and no symlinks. The HMAT erodes the concept of "numa nodes" typically being a single digit number space per platform. Given increasing numbers of memory target types and initiator devices its going to be cumbersome to have userspace walk multiple symlinks vs just reading a mask and opening the canonical path for a node directly. This is also part of the rationale for only emitting one "class" (initiator / target performance profile) by default. There's an N-to-N initiator-target description in the HMAT. When / if we decide emit more classes the more work userspace would need to do to convert directory structures back into data.