Skip to content

Conversation

@ycsin
Copy link
Member

@ycsin ycsin commented Nov 7, 2024

Basically the same idea as #77038

The sched benchmark is designed for systems with a single CPU. Otherwise, the timestamps would be wrong when the partner thread is scheduled on another CPU, i.e. negative values:

unpend   63 ready   62 switch -16562 pend 18937 tot 2500 (avg  928)

When the system allows for multiple CPUs, spawn a non-preemptible thread to keep the other CPUs busy.

The sched benchmark is designed for systems with a single
CPU. Otherwise, the timestamps would be wrong when the partner
thread is scheduled on another CPU, i.e. negative values:

```
unpend   63 ready   62 switch -16562 pend 18937 tot 2500 (avg  928)
```

When the system allows for multiple CPUs, spawn a non-preemptible
thread to keep the other CPUs busy.

Signed-off-by: Yong Cong Sin <[email protected]>
@ycsin ycsin added area: Tests Issues related to a particular existing or missing test area: Benchmarks labels Nov 7, 2024
@ycsin ycsin marked this pull request as ready for review November 7, 2024 16:10
@ycsin ycsin requested a review from peter-mitsis November 7, 2024 16:10
@zephyrbot zephyrbot requested review from dcpleung and nashif November 7, 2024 16:10
peter-mitsis
peter-mitsis previously approved these changes Nov 7, 2024
@peter-mitsis
Copy link
Contributor

I just remembered about something. Adding the busy threads can really slow down some simulators (such as the intel_adsp_xxx simulators. Can you please add similar board overlays proposed for the latency_measure benchmark (see ff3a8d9) for the sched benchmark?

Due to addition of busy threads running on other cores, and
the simulator runs in single thread bouncing through all cores,
we are wasting quite a bit of time just busy waiting. This makes
each simulator run too long for CI. So limit CPU number to 1.

Signed-off-by: Daniel Leung <[email protected]>
Signed-off-by: Yong Cong Sin <[email protected]>
@ycsin
Copy link
Member Author

ycsin commented Nov 8, 2024

stole ff3a8d9, cc @dcpleung

@ycsin ycsin requested a review from peter-mitsis November 8, 2024 14:47
@nashif nashif merged commit e0ce096 into zephyrproject-rtos:main Nov 16, 2024
17 checks passed
@ycsin ycsin deleted the pr/sched-smp branch November 17, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Benchmarks area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants