Linux-kselftest Archive mirror
 help / color / mirror / Atom feed
From: "Chen, Zide" <zide.chen@intel.com>
To: Sean Christopherson <seanjc@google.com>
Cc: linux-kselftest@vger.kernel.org, pbonzini@redhat.com,
	donsheng <dongsheng.x.zhang@intel.com>
Subject: Re: [PATCH V3] KVM: selftests: Add a new option to rseq_test
Date: Mon, 29 Apr 2024 16:16:33 -0700	[thread overview]
Message-ID: <5d3c3fa2-5250-41e0-adf7-ee7bf7501b3d@intel.com> (raw)
In-Reply-To: <Zi_3bNOgJl1m0wXy@google.com>



On 4/29/2024 12:39 PM, Sean Christopherson wrote:
>> Signed-off-by: Zide Chen <zide.chen@intel.com>
>> Signed-off-by: donsheng <dongsheng.x.zhang@intel.com>
> 
> Why does this have Donghsheng's SoB?  Is this a Co-developed-by situation?

Yes, Co-developed-by is more suitable.

>>
> 
> Put per-patch notes that aren't intended for the final changelog...
> 
>> V2:
>> - removed the busy loop implementation
>> - add the new "-s" option
>>
>> V3:
>> - drop the usleep randomization code
>> - removed the term C-state for less confusion for non-x86 archetectures
>> - changed subject
>> ---
> 
> ...down here below the "---", as this section is ignored by `git am`.  That way
> the maintainer (me) doesn't need to manually delete the notes when applying.

Got it, thank you very much!

>>  tools/testing/selftests/kvm/rseq_test.c | 40 +++++++++++++++++++++++--
>>  1 file changed, 38 insertions(+), 2 deletions(-)
> 
>> +static void help(const char *name)
>> +{
>> +	puts("");
>> +	printf("usage: %s [-h] [-s]\n", name);
>> +	printf(" -s: skip the sanity check for successful KVM_RUN.\n");
> 
> Hmm, -s ends up being somewhat confusing because "sanity" also starts with 's',
> e.g. my first thought is that "./rseq_test -s" would be "run the test with sanity
> checks".
> 
> Maybe -u for unchecked/unverified?

Agree, it's better.

> 	printf(" -u: Don't sanity check the number of successful KVM_RUNs\n");
> 
>> @@ -254,9 +277,22 @@ int main(int argc, char *argv[])
>>  	 * getcpu() to stabilize.  A 2:1 migration:KVM_RUN ratio is a fairly
>>  	 * conservative ratio on x86-64, which can do _more_ KVM_RUNs than
>>  	 * migrations given the 1us+ delay in the migration task.
>> +	 *
>> +	 * Another reason why it may have small migration:KVM_RUN ratio is that,
>> +	 * on systems with large low power mode wakeup latency, it may happen
>> +	 * quite often that the scheduler is not able to wake up the target CPU
>> +	 * before the vCPU thread is scheduled to another CPU.
>>  	 */
>> -	TEST_ASSERT(i > (NR_TASK_MIGRATIONS / 2),
>> -		    "Only performed %d KVM_RUNs, task stalled too much?", i);
>> +	TEST_ASSERT(skip_sanity_check || i > (NR_TASK_MIGRATIONS / 1),
>> +		    "Only performed %d KVM_RUNs, task stalled too much? \n"
>> +		    "  Try to run it with -s option, or disable deep sleep "
>> +		    "states in the system,\n"
>> +		    "  e.g., boot the host with cpuidle.off=1 or other driver "
>> +		    "specific kernel options,\n"
>> +		    "  or do it through the PM QoS interface at runtime: \n"
>> +		    "    cat > /dev/cpu_dma_latency <(echo -e -n "
>> +		    "\"\\x0\\x0\\x0\\x0\"; sleep inf) &\n"
>> +		    "    PID=$! && run_the_test && kill $PID" , i);
> 
> I appreciate trying to be helpful, but this is a bit too verbose.  I would also
> prefer to call out the command line option last, e.g. so that readers don't
> automatically rerun with the sanity check disabled without reading the rest of
> the error message.
> 
> How about this?
> 
> 
> 	TEST_ASSERT(skip_sanity_check || i > (NR_TASK_MIGRATIONS / 1),
> 		    "Only performed %d KVM_RUNs, task stalled too much? \n"
>                     "Try disabling deep sleep states to reduce CPU wakeup latency,\n"
> 		    "e.g. via cpuidle.off=1 or setting /dev/cpu_dma_latency to '0',\n"
>                     "or run with -u to disable this sanity check", i);

Thank you very much for your patience and your suggestions! I'll adopt
them to V4. How baout to add two white spaces in front of the 2nd, 3rd
and 4th in order to align with the first line (Only performed ... )?

==== Test Assertion Failure ====
  rseq_test.c:286: skip_sanity_check || i > (NR_TASK_MIGRATIONS / 1)
  pid=17851 tid=17851 errno=4 - Interrupted system call
     1  0x00000000004029da: main at rseq_test.c:286
     2  0x00007ff615029d8f: ?? ??:0
     3  0x00007ff615029e3f: ?? ??:0
     4  0x0000000000402ab4: _start at ??:?
  Only performed 22249 KVM_RUNs, task stalled too much?
  Try disabling deep sleep states to reduce CPU wakeup latency,
  e.g. via cpuidle.off=1 or setting /dev/cpu_dma_latency to '0',
  or run with -u to disable this sanity check.

      reply	other threads:[~2024-04-29 23:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 22:51 [PATCH V3] KVM: selftests: Add a new option to rseq_test Zide Chen
2024-04-29 19:39 ` Sean Christopherson
2024-04-29 23:16   ` Chen, Zide [this message]

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=5d3c3fa2-5250-41e0-adf7-ee7bf7501b3d@intel.com \
    --to=zide.chen@intel.com \
    --cc=dongsheng.x.zhang@intel.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).