linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>,
	Keith Busch <keith.busch@intel.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	linux-mm@kvack.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rafael Wysocki <rafael@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 0/7] ACPI HMAT memory sysfs representation
Date: Mon, 26 Nov 2018 09:20:04 -0800	[thread overview]
Message-ID: <3b86c5c5-53f2-29bf-48e7-5749c7287dca@intel.com> (raw)
In-Reply-To: <1a9e887b-8087-e897-6195-e8df325bd458@arm.com>

On 11/26/18 7:38 AM, Anshuman Khandual wrote:
> On 11/24/2018 12:51 AM, Dave Hansen wrote:
>> On 11/22/18 10:42 PM, Anshuman Khandual wrote:
>>> Are we willing to go in the direction for inclusion of a new system
>>> call, subset of it appears on sysfs etc ? My primary concern is not
>>> how the attribute information appears on the sysfs but lack of it's
>>> completeness.
>>
>> A new system call makes total sense to me.  I have the same concern
>> about the completeness of what's exposed in sysfs, I just don't see a
>> _route_ to completeness with sysfs itself.  Thus, the minimalist
>> approach as a first step.
> 
> Okay if we agree on the need for a new specific system call extracting
> the superset attribute information MAX_NUMNODES * MAX_NUMNODES * U64
> (u64 packs 8 bit values for 8 attributes or something like that) as we
> had discussed before, it makes sense to export a subset of it which can
> be faster but useful for the user space without going through a system
> call. 

The information that needs to be exported is a bit more than that.  It's
not just a binary attribute.

The information we have from the new ACPI table, for instance, is the
read and write bandwidth and latency between two nodes.  They are, IIRC,
two-byte values in the ACPI table[1], each.  That's 8 bytes worth of
data right there, which wouldn't fit *anything* else.

The list of things we want to export will certainly grow.  That means we
need a syscall something like this:

int get_mem_attribute(unsigned long attribute_nr,
		      unsigned long __user * initiator_nmask,
		      unsigned long __user * target_nmask,
		      unsigned long maxnode,
		      unsigned long *attributes_out);

#define MEM_ATTR_READ_BANDWIDTH		1
#define MEM_ATTR_WRITE_BANDWIDTH	2
#define MEM_ATTR_READ_LATENCY		3
#define MEM_ATTR_WRITE_LATENCTY		4
#define MEM_ATTR_ENCRYPTION		5

If you want to know the read latency between nodes 4 and 8, you do:

	ret = get_mem_attr(MEM_ATTR_READ_LATENCY,
			   (1<<4), (1<<8), max, &array);

And the answer shows up at array[0] in this example.  If you had more
than one bit set in the two nmasks, you would have a longer array.

The length of the array is the number of bits set in initiator_nmask *
the number of bits set in target_nmask * sizeof(ulong).

This has the advantage of supporting ULONG_MAX attributes, and scales
from asking for one attribute at a time all the way up to dumping the
entire system worth of data for a single attribute.  The only downside
is that it's one syscall per attribute instead of packing them all
together.  But, if we have a small enough number to pack them in one
ulong, then I think we can make 64 syscalls without too much trouble.

> Do you agree on a (system call + sysfs) approach in principle ?
> Also sysfs exported information has to be derived from whats available
> through the system call not the other way round. Hence the starting
> point has to be the system call definition.

Both the sysfs information *and* what will be exported in any future
interfaces are derived from platform-specific information.  They are not
derived from one _interface_ or the other.

They obviously need to be consistent, though.

1. See "Table 5-142 System Locality Latency and Bandwidth Information
Structure" here:
http://www.uefi.org/sites/default/files/resources/ACPI_6_2.pdf

  reply	other threads:[~2018-11-26 17:20 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 22:49 [PATCH 0/7] ACPI HMAT memory sysfs representation Keith Busch
2018-11-16  6:27 ` Anshuman Khandual
2018-11-16 15:51   ` Keith Busch
2018-11-19  1:52     ` Anshuman Khandual
2018-11-16 16:55   ` Dave Hansen
2018-11-19  5:44     ` Anshuman Khandual
2018-11-19 17:37       ` Dave Hansen
2018-11-22 11:52         ` Anshuman Khandual
2018-11-22 18:01           ` Dave Hansen
2018-11-23  6:42             ` Anshuman Khandual
2018-11-23 19:21               ` Dave Hansen
2018-11-23 21:13                 ` Dan Williams
2018-11-26 15:52                   ` Anshuman Khandual
2018-11-26 16:42                   ` Dave Hansen
2018-11-26 18:08                     ` Dan Williams
2018-11-27 10:15                       ` Anshuman Khandual
2018-11-27 16:56                         ` Dan Williams
2018-11-26 15:38                 ` Anshuman Khandual
2018-11-26 17:20                   ` Dave Hansen [this message]
2018-11-27  9:32                     ` Anshuman Khandual
2018-11-22 18:08           ` Dan Williams
2018-11-23  7:10             ` Anshuman Khandual
2018-11-23 17:15               ` Dan Williams
2018-11-27 14:05                 ` Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b86c5c5-53f2-29bf-48e7-5749c7287dca@intel.com \
    --to=dave.hansen@intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keith.busch@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).