On Tue, Jun 06, 2017 at 11:58:49AM +0800, Eli Qiao wrote:
hi Martin
The code looks good to me, I have 1 comment for the granularity’s comment, and another one
for the test data.
Otherwise, looks perfect, good to learn how to deal with hex
I just copied that from virhostcpu.c
[...]
> create mode 100644
tests/vircaps2xmldata/linux-resctrl-skx/system/cpu/cpu0/cache/index0/type
It seems you miss cache/index3 ?
Why? I don't have any system to copy this from, so I just created the
smallest test that has all the info in it. It's one socket, one core,
one thread system with only one cache. More that that is not necessary
unless it actually tests something as well. In this case everything
else is tested in other cases, I believe. For now, that is.
> diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
> index ee87d598ef66..d4753db0beec 100644
> --- a/src/conf/capabilities.h
> +++ b/src/conf/capabilities.h
> @@ -152,6 +152,7 @@ typedef struct _virCapsHostCacheControl virCapsHostCacheControl;
> typedef virCapsHostCacheControl *virCapsHostCacheControlPtr;
> struct _virCapsHostCacheControl {
> unsigned long long min; /* minimum cache control size in B */
> + unsigned long long granularity; /* minimum increase step for min in B */
The comments may look confused, and it will be better to describe min will be optional if
min equal to granularity.
I'll rewrite the comments
> diff --git
a/tests/vircaps2xmldata/linux-resctrl-skx/system/cpu/cpu0/cache/index0/size
b/tests/vircaps2xmldata/linux-resctrl-skx/system/cpu/cpu0/cache/index0/size
> new file mode 100644
> index 000000000000..24a7d60e7fb9
> --- /dev/null
> +++ b/tests/vircaps2xmldata/linux-resctrl-skx/system/cpu/cpu0/cache/index0/size
> @@ -0,0 +1 @@
> +11264K
>
>
I checked that on SKX, the cache size is 33792K (33M), it’s good that it can be divided by
11.
That makes sense. Let's try 33M, so that it's at least similar in that.