Re: [PATCH 07/13] selftests: KVM: Add NX huge pages test

From: Ben Gardon
Date: Thu Mar 10 2022 - 12:07:16 EST


On Thu, Mar 10, 2022 at 10:59 AM David Dunn <daviddunn@xxxxxxxxxx> wrote:
>
> Ben,
>
> Thanks for adding this test. Nit below.
>
> Reviewed-by: David Dunn <daviddunn@xxxxxxxxxx>
>
> On Thu, Mar 10, 2022 at 8:46 AM Ben Gardon <bgardon@xxxxxxxxxx> wrote:
>>
>>
>> + /* Give recovery thread time to run */
>> + sleep(3);
>>
> Is there any way to make this sleep be based on constants which control the recovery thread? Looking at the parameters below, this seems excessive. The recovery period is 2ms with a 1/1=100% recovery ratio. So this is padded out 1000x. Maybe it doesn't matter because normally this test runs in parallel with other tests, but it does seem like a pretty large hardcoded sleep.

Woops, I meant to make the recovery period 2 seconds, which would also
be preposterously large. We absolutely can and should tighten that up.
100ms recovery period and 150ms sleep would probably work perfectly.
I'll make that change if/when I send out a v2.

>
> Dave