lkml.org 
[lkml]   [2021]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] selftests: KVM: use dirty logging to check if page stats work correctly
From
On 23/08/21 23:36, Ben Gardon wrote:
>> +#ifdef __x86_64__
>> + TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_4K) != 0,
>> + "4K page is zero");
>> + if (p->backing_src == VM_MEM_SRC_ANONYMOUS_THP)
>> + TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_2M) != 0,
>> + "2M page is zero");
>> + if (p->backing_src == VM_MEM_SRC_ANONYMOUS_HUGETLB_1GB)
>> + TEST_ASSERT(get_page_stats(X86_PAGE_SIZE_1G) != 0,
>> + "1G page is zero");
>> +#endif
> This check is correct, but it misses some cases. It'd be worth going
> back to ensure that all relevant backing src types are handled here.
> For example, this misses VM_MEM_SRC_ANONYMOUS_HUGETLB_2MB.
>
> We could also be more precise by asserting that the counts are at
> least some value or total to some value. THP introduces some flakiness
> but one way or another the mapping counts at this point should total
> up to account for the expected size of guest memory.
>

I am worried about flakiness here. I would prefer to have just a check
that _some_ pagesize is nonzero.

Also even for 1GB hugetlbfs not all processors support gigabyte pages,
so for those the stat would be 0.

Finally, please use the binary statistics interface, so that the test
does not require root.

Paolo

\
 
 \ /
  Last update: 2021-10-15 18:20    [W:0.051 / U:2.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site