This test simply counts how many times `eventfd_read()` and `eventfd_write()` can be called on an `eventfd(0, EFD_SEMAPHORE | EFD_NONBLOCK)` file descriptor. Prior to the recent changes in `eventfd`, we were seeing approximately < 1000 writes / s. However, the previous `eventfd` implementation would fail this test with the result that the number of successful reads was far greater than the number of successful writes. This should be impossible, and with the recent `eventfd` changes that was fixed. Additionally, we are seeing an increase in over 40x for non-blocking eventfd reads and writes. ``` START - test_stress I: BOARD: qemu_riscv64_smp I: TEST_DURATION_S: 5 I: UPDATE_INTERVAL_S: 1 I: avg: 48537 reads/s I: avg: 48575 writes/s PASS - test_stress in 5.002 seconds ``` Signed-off-by: Christopher Friedt <cfriedt@meta.com>
43 lines
1.2 KiB
Text
43 lines
1.2 KiB
Text
# Copyright (c) 2023, Meta
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
source "Kconfig.zephyr"
|
|
|
|
config TEST_DURATION_S
|
|
int "Number of seconds to run the test"
|
|
range 1 21600
|
|
default 5
|
|
help
|
|
Duration for the test, in seconds. The range has a reblatively high
|
|
upper bound because we should expect that eventfd_read() and
|
|
eventfd_write() are stable enough to run for an arbitrarily long
|
|
period of time without encountering any race conditions.
|
|
|
|
config TEST_TIMEOUT_S
|
|
int "Number of seconds to run the test"
|
|
range 1 21600
|
|
default 10
|
|
|
|
config TEST_STACK_SIZE
|
|
int "Size of each thread stack in this test"
|
|
default 2048
|
|
help
|
|
The minimal stack size required to run a no-op thread.
|
|
|
|
config TEST_EXTRA_ASSERTIONS
|
|
bool "Add extra assertions into the hot path"
|
|
help
|
|
In order to get a true benchmark, there should be as few branches
|
|
as possible on the hot path. Say 'y' here to add extra assertions
|
|
on the hot path as well to verify functionality.
|
|
|
|
config TEST_EXTRA_QUIET
|
|
bool "Do not print out regular reports"
|
|
help
|
|
In order to get a true benchmark, there should be as few branches
|
|
as possible on the hot path. Say 'y' here to skip reporting.
|
|
|
|
module = EVENTFD_TEST
|
|
module-str = eventfd
|
|
source "subsys/logging/Kconfig.template.log_config"
|