Skip to contentSkip to conversation

how to add cpu load in testing latency

DISCUSSION mars_liu 2 participants 4 messages Sep 27, 2024 – Oct 16, 2024

lore
Share & tools
lore

mars_liu

author
#0 lore raw

hi xenomai,

i'm trying to test latency with full cpu load .

it has 4 cpu cores,and there are two mode cause full cpu load :
1.
for num in seq 4
do
dd if=/dev/zero of=/dev/null bs=16M
done
2.
stress --cpu 4

latency test command is '/usr/lib/xenomai/testsuite/latency -P 90 -p 100 -c 2 -T 43200'.

the test results show that latency of mode 2 is much better than mode 1 .

my question is which mode of full cpu load is suitable.

Regards, mars_liu

#1 lore raw
Quoted 15 lines · mars_liu

hi xenomai,

i'm trying to test latency with full cpu load .

it has 4 cpu cores,and there are two mode cause full cpu load :
1.
for num in seq 4
do
dd if=/dev/zero of=/dev/null bs=16M
done
2.
stress --cpu 4

Quoted 4 lines

latency test command is '/usr/lib/xenomai/testsuite/latency -P 90 -p 100 -c 2 -T 43200'.

the test results show that latency of mode 2 is much better than mode 1 .

No surprise:

"1=kernel task, 2=timer IRQ"

Quoted 2 lines

my question is which mode of full cpu load is suitable.

The mode above has nothing to do with "full cpu load". You are testing differently "heavy" RT code path by switching the mode of latency.

Jan

Signature · 2 lines
Siemens AG, Technology
Linux Expert Center
author
#2 lore raw
Quoted 7 lines · Jan Kiszka
Quoted 6 lines · mars_liu

hi xenomai,

i'm trying to test latency with full cpu load .

Quoted 9 lines
Quoted 9 lines

it has 4 cpu cores,and there are two mode cause full cpu load :
1.
for num in seq 4
do
dd if=/dev/zero of=/dev/null bs=16M
done
2.
stress --cpu 4

I may have mixed up the word 'mode' above.

the argument for 'latency -t' is always 0(default) in this test .

the 'mode' i mean a method above that generate cpu load .

should i use 'stress --cpu' or 'dd if ......' to generate cpu load for 'latency -t 0' ?

Regards

author
#3 lore raw

Hi Jan,

Recently I have been learning how to add cpu load when performing latency tests.

Keeping the  latency mode at it's default setting of 0.

I found the following description in the xenomai documentation:
Dohell script allows to generate a synthetic load (network load, disk I/O load, cpu load, and Linux syscalls coverage with LTP).

How dohell to generate cpu load?
Does dohell generate cpu load by executing "dd if=/dev/zero of=/dev/null"?

I tried to execute "dd if..." to generate cpu load during the  latency test, and the latency test result are worse than execute "stress --cpu x".

What's the difference between the "dd if" and "stress --cpu" for generate cpu load.

Additionally, I'm seeking guidance on which approach or any alternative methods you recommend adopting for augmenting CPU load when conducting latency tests within Xenomai.

Thanks for your time and insights, best Regards

Mars_liu.

---- Replied Message ----

                From
                mars_liu<[email protected]>
            
            
                Date
                10/10/2024 15:21
            
            
                To
                Jan Kiszka<[email protected]>
            
            
                Cc
                xenomai<[email protected]>
            
            
                Subject
                Re:Re: how to add cpu load in testing latency
Quoted 7 lines · Jan Kiszka
Quoted 6 lines · mars_liu

hi xenomai,

i'm trying to test latency with full cpu load .

Quoted 9 lines
Quoted 9 lines

it has 4 cpu cores,and there are two mode cause full cpu load :
1.
for num in seq 4
do
dd if=/dev/zero of=/dev/null bs=16M
done
2.
stress --cpu 4

I may have mixed up the word 'mode' above.

the argument for 'latency -t' is always 0(default) in this test .

the 'mode' i mean a method above that generate cpu load .

should i use 'stress --cpu' or 'dd if ......' to generate cpu load for 'latency -t 0' ?

Regards