Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: Brice Goglin <brice.goglin@gmail.com>, <linux-cxl@vger.kernel.org>
Cc: <dan.j.williams@intel.com>, <ira.weiny@intel.com>,
	<vishal.l.verma@intel.com>, <alison.schofield@intel.com>,
	<jonathan.cameron@huawei.com>, <dave@stgolabs.net>
Subject: Re: [PATCH 2/3] cxl/region: Add sysfs attribute for locality attributes of CXL regions
Date: Tue, 12 Dec 2023 09:00:54 -0700	[thread overview]
Message-ID: <5197621d-7ac4-4ed8-a4b2-81136b531fa7@intel.com> (raw)
In-Reply-To: <d7d17fd4-9587-4786-af58-a68d1ebe074f@gmail.com>



On 12/12/23 06:46, Brice Goglin wrote:
> Le 08/12/2023 à 00:31, Dave Jiang a écrit :
> 
>> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
>> index d879f5702cf2..72c47f624d63 100644
>> --- a/drivers/cxl/core/region.c
>> +++ b/drivers/cxl/core/region.c
>> @@ -645,6 +645,26 @@ static ssize_t size_show(struct device *dev, struct device_attribute *attr,
>>   }
>>   static DEVICE_ATTR_RW(size);
>>   +#define ACCESS_ATTR(attrib)                    \
>> +static ssize_t attrib##_show(struct device *dev,        \
>> +               struct device_attribute *attr,    \
>> +               char *buf)                \
>> +{                                \
>> +    struct cxl_region *cxlr = to_cxl_region(dev);        \
>> +                                \
>> +    if (!cxlr->coord)                    \
>> +        return 0;                    \
>> +                                \
>> +    return sysfs_emit(buf, "%u\n",                \
>> +              cxlr->coord->attrib);            \
>> +}                                \
> 
> Hello
> 
> Latencies ares off by a factor of 1000 here (I see 586/686 for r/w attributes
> for NUMA nodes in Qemu but 1000x higher for region attributes). For NUMA node attributes,
> you're dividing latencies by a factor a 1000 in cxl_region_perf_attrs_callback():
>  
>         /* Adjust latencies from psec to nsec to be consistent with HMAT targets */
>         coord = *cxlr->coord;
>         coord.read_latency = DIV_ROUND_UP(coord.read_latency, 1000);
>         coord.write_latency = DIV_ROUND_UP(coord.write_latency, 1000);
> 
> For region attributes, I think you're missing the same?

Yes.... I was keeping the original computed raw data in picosecond base. Maybe I should just convert it to nanoseconds here since that's what Linux uses to begin with just to be consistent everywhere. 
> 
> Brice
> 

  reply	other threads:[~2023-12-12 16:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 23:31 [PATCH 0/3] cxl: Add support to report region access coordinates to numa nodes Dave Jiang
2023-12-07 23:31 ` [PATCH 1/3] cxl/region: Calculate performance data for a region Dave Jiang
2023-12-11 17:44   ` fan
2023-12-12  0:19   ` Dan Williams
2023-12-07 23:31 ` [PATCH 2/3] cxl/region: Add sysfs attribute for locality attributes of CXL regions Dave Jiang
2023-12-11  9:06   ` Brice Goglin
2023-12-12 19:30     ` Dave Jiang
2023-12-19 16:44       ` Jonathan Cameron
2023-12-20 20:26         ` Dave Jiang
2023-12-21 18:23           ` Dave Jiang
2023-12-11 18:03   ` fan
2023-12-11 18:13     ` Dave Jiang
2023-12-11 18:27       ` fan
2023-12-12  0:23   ` Dan Williams
2023-12-12 13:46   ` Brice Goglin
2023-12-12 16:00     ` Dave Jiang [this message]
2023-12-07 23:32 ` [PATCH 3/3] cxl: Add memory hotplug notifier for cxl region Dave Jiang
2023-12-08  3:35   ` Huang, Ying
2023-12-12  0:30   ` Dan Williams

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=5197621d-7ac4-4ed8-a4b2-81136b531fa7@intel.com \
    --to=dave.jiang@intel.com \
    --cc=alison.schofield@intel.com \
    --cc=brice.goglin@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave@stgolabs.net \
    --cc=ira.weiny@intel.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=vishal.l.verma@intel.com \
    /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