qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
@ 2024-01-15  7:02 Thomas Huth
  2024-01-15 11:07 ` Philippe Mathieu-Daudé
  2024-01-15 11:32 ` Alex Bennée
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Huth @ 2024-01-15  7:02 UTC (permalink / raw)
  To: qemu-devel, Tyrone Ting, Hao Wu; +Cc: qemu-arm

The test_prescaler() part in the npcm7xx_watchdog_timer test is quite
repetive, testing all possible combinations of the WTCLK and WTIS
bitfields. Since each test spins up a new instance of QEMU, this is
rather an expensive test, especially on loaded host systems.
For the normal quick test mode, it should be sufficient to test the
corner settings of these fields (i.e. 0 and 3), so we can speed up
this test in the default mode quite a bit.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/npcm7xx_watchdog_timer-test.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/npcm7xx_watchdog_timer-test.c b/tests/qtest/npcm7xx_watchdog_timer-test.c
index 4773a673b2..981b853c99 100644
--- a/tests/qtest/npcm7xx_watchdog_timer-test.c
+++ b/tests/qtest/npcm7xx_watchdog_timer-test.c
@@ -172,9 +172,10 @@ static void test_reset_action(gconstpointer watchdog)
 static void test_prescaler(gconstpointer watchdog)
 {
     const Watchdog *wd = watchdog;
+    int inc = g_test_quick() ? 3 : 1;
 
-    for (int wtclk = 0; wtclk < 4; ++wtclk) {
-        for (int wtis = 0; wtis < 4; ++wtis) {
+    for (int wtclk = 0; wtclk < 4; wtclk += inc) {
+        for (int wtis = 0; wtis < 4; wtis += inc) {
             QTestState *qts = qtest_init("-machine quanta-gsj");
 
             qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
  2024-01-15  7:02 [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default Thomas Huth
@ 2024-01-15 11:07 ` Philippe Mathieu-Daudé
  2024-01-15 11:32 ` Alex Bennée
  1 sibling, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-15 11:07 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Tyrone Ting, Hao Wu; +Cc: qemu-arm

On 15/1/24 08:02, Thomas Huth wrote:
> The test_prescaler() part in the npcm7xx_watchdog_timer test is quite
> repetive, testing all possible combinations of the WTCLK and WTIS
> bitfields. Since each test spins up a new instance of QEMU, this is
> rather an expensive test, especially on loaded host systems.
> For the normal quick test mode, it should be sufficient to test the
> corner settings of these fields (i.e. 0 and 3), so we can speed up
> this test in the default mode quite a bit.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   tests/qtest/npcm7xx_watchdog_timer-test.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

Good idea.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
  2024-01-15  7:02 [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default Thomas Huth
  2024-01-15 11:07 ` Philippe Mathieu-Daudé
@ 2024-01-15 11:32 ` Alex Bennée
  2024-01-15 11:36   ` Thomas Huth
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Bennée @ 2024-01-15 11:32 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Tyrone Ting, Hao Wu, qemu-arm

Thomas Huth <thuth@redhat.com> writes:

> The test_prescaler() part in the npcm7xx_watchdog_timer test is quite
> repetive, testing all possible combinations of the WTCLK and WTIS
> bitfields. Since each test spins up a new instance of QEMU, this is
> rather an expensive test, especially on loaded host systems.

I'm not against the change but I do not my home machine runs these tests
in:

  1/1 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test        OK              0.18s   180 subtests passed

so I do wonder how the system load can cause such a dramatic increase
for a comparatively simple test.

> For the normal quick test mode, it should be sufficient to test the
> corner settings of these fields (i.e. 0 and 3), so we can speed up
> this test in the default mode quite a bit.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qtest/npcm7xx_watchdog_timer-test.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/qtest/npcm7xx_watchdog_timer-test.c b/tests/qtest/npcm7xx_watchdog_timer-test.c
> index 4773a673b2..981b853c99 100644
> --- a/tests/qtest/npcm7xx_watchdog_timer-test.c
> +++ b/tests/qtest/npcm7xx_watchdog_timer-test.c
> @@ -172,9 +172,10 @@ static void test_reset_action(gconstpointer watchdog)
>  static void test_prescaler(gconstpointer watchdog)
>  {
>      const Watchdog *wd = watchdog;
> +    int inc = g_test_quick() ? 3 : 1;
>  
> -    for (int wtclk = 0; wtclk < 4; ++wtclk) {
> -        for (int wtis = 0; wtis < 4; ++wtis) {
> +    for (int wtclk = 0; wtclk < 4; wtclk += inc) {
> +        for (int wtis = 0; wtis < 4; wtis += inc) {
>              QTestState *qts = qtest_init("-machine quanta-gsj");
>  
>              qtest_irq_intercept_in(qts, "/machine/soc/a9mpcore/gic");

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
  2024-01-15 11:32 ` Alex Bennée
@ 2024-01-15 11:36   ` Thomas Huth
  2024-01-15 11:45     ` Alex Bennée
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2024-01-15 11:36 UTC (permalink / raw)
  To: Alex Bennée; +Cc: qemu-devel, Tyrone Ting, Hao Wu, qemu-arm

On 15/01/2024 12.32, Alex Bennée wrote:
> Thomas Huth <thuth@redhat.com> writes:
> 
>> The test_prescaler() part in the npcm7xx_watchdog_timer test is quite
>> repetive, testing all possible combinations of the WTCLK and WTIS
>> bitfields. Since each test spins up a new instance of QEMU, this is
>> rather an expensive test, especially on loaded host systems.
> 
> I'm not against the change but I do not my home machine runs these tests
> in:
> 
>    1/1 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test        OK              0.18s   180 subtests passed

That's a different test, I think. Look for "watchdog" in its name, please.

> so I do wonder how the system load can cause such a dramatic increase
> for a comparatively simple test.

The watchdog test is executing a new QEMU instance for each test in the 
loop, and that can be quite expensive on a loaded system, I think.

  Thomas



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default
  2024-01-15 11:36   ` Thomas Huth
@ 2024-01-15 11:45     ` Alex Bennée
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Bennée @ 2024-01-15 11:45 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Tyrone Ting, Hao Wu, qemu-arm

Thomas Huth <thuth@redhat.com> writes:

> On 15/01/2024 12.32, Alex Bennée wrote:
>> Thomas Huth <thuth@redhat.com> writes:
>> 
>>> The test_prescaler() part in the npcm7xx_watchdog_timer test is quite
>>> repetive, testing all possible combinations of the WTCLK and WTIS
>>> bitfields. Since each test spins up a new instance of QEMU, this is
>>> rather an expensive test, especially on loaded host systems.
>> I'm not against the change but I do not my home machine runs these
>> tests
>> in:
>>    1/1 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_timer-test        OK
>> 0.18s   180 subtests passed
>
> That's a different test, I think. Look for "watchdog" in its name,
> please.

Ahh -ETOOMANYNPCMS...

So yes I get a drop in time by half:

  1/1 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_watchdog_timer-test        OK             10.35s   15 subtests passed

to

  1/1 qemu:qtest+qtest-arm / qtest-arm/npcm7xx_watchdog_timer-test        OK              4.68s   15 subtests passed


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

>> so I do wonder how the system load can cause such a dramatic increase
>> for a comparatively simple test.
>
> The watchdog test is executing a new QEMU instance for each test in
> the loop, and that can be quite expensive on a loaded system, I think.
>
>  Thomas

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-15 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15  7:02 [PATCH] tests/qtest/npcm7xx_watchdog_timer: Only test the corner cases by default Thomas Huth
2024-01-15 11:07 ` Philippe Mathieu-Daudé
2024-01-15 11:32 ` Alex Bennée
2024-01-15 11:36   ` Thomas Huth
2024-01-15 11:45     ` Alex Bennée

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 NNTP newsgroup(s).