Skip to content

AArch64 scheduler performs worse when optimized #2665

Description

@mkroening

hermit-c's pthreads.c test performs considerably worse when kernel optimizations are enabled. Suddenly, we have a huge number of rescheduling interrupts. This should be possible to reproduce in Rust.

$ cargo xtask ci c --arch aarch64 --target pthreads --smp 4 qemu
...
../src/pthreads.c:44: assert(count_value == parallelism * ITERATIONS) successful
[   36.035796][0][INFO  interrupts] Number of interrupts
[   36.039786][0][INFO  interrupts] [0][Reschedule]: 5
[   36.040927][0][INFO  interrupts] [1][Reschedule]: 3
[   36.041966][0][INFO  interrupts] [2][Reschedule]: 3
[   36.042901][0][INFO  interrupts] [3][Reschedule]: 3

40e0c6e (a year ago):

$ cargo xtask ci c --arch aarch64 --buildtype release --target pthreads --smp 4 qemu
...
../src/pthreads.c:47: assert(count_value == parallelism * ITERATIONS) successful
[   41.790805][0][INFO] Number of interrupts
[   37.063989][0][INFO] [0][Reschedule]: 101420
[   37.064255][0][INFO] [1][Reschedule]: 165798
[   37.064444][0][INFO] [2][Reschedule]: 164730
[   37.064600][0][INFO] [3][Reschedule]: 110663

5312fca (current main):

$ cargo xtask ci c --arch aarch64 --buildtype release --target pthreads --smp 4 qemu
...
../src/pthreads.c:44: assert(count_value == parallelism * ITERATIONS) successful
[   47.009291][0][INFO  interrupts] Number of interrupts
[   43.805069][0][INFO  interrupts] [0][Reschedule]: 349560
[   43.805359][0][INFO  interrupts] [1][Reschedule]: 632670
[   43.805540][0][INFO  interrupts] [2][Reschedule]: 326619
[   43.805706][0][INFO  interrupts] [3][Reschedule]: 671266

A workaround for this worsening of performance in the last year is added in:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions