diff options
| author | Ming Lei <ming.lei@redhat.com> | 2025-04-12 10:30:24 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-04-16 19:32:18 -0600 |
| commit | 2f0a692a93a585ead9ccffd0642694946d74411f (patch) | |
| tree | ed463b75c563c16d0e4e47a975ffa449692acce3 /tools/testing/selftests/ublk/kublk.h | |
| parent | 62867a046a223e6eb771e23d2048e839c1d949d7 (diff) | |
| download | linux-next-2f0a692a93a585ead9ccffd0642694946d74411f.tar.gz linux-next-2f0a692a93a585ead9ccffd0642694946d74411f.zip | |
selftests: ublk: set queue pthread's cpu affinity
In NUMA machine, ublk IO performance is very sensitive with queue
pthread's affinity setting.
Retrieve queue's affinity and select the 1st cpu as queue thread's sched
affinity, and it is observed that single cpu task affinity can get
stable & good performance if client application is put on proper cpu.
Dump this info when adding one ublk device. Use shmem to communicate
queue's tid between parent and daemon.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250412023035.2649275-9-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/testing/selftests/ublk/kublk.h')
| -rw-r--r-- | tools/testing/selftests/ublk/kublk.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/testing/selftests/ublk/kublk.h b/tools/testing/selftests/ublk/kublk.h index eccf12360a14..85295d3e36cb 100644 --- a/tools/testing/selftests/ublk/kublk.h +++ b/tools/testing/selftests/ublk/kublk.h @@ -20,10 +20,15 @@ #include <sys/wait.h> #include <sys/eventfd.h> #include <sys/uio.h> +#include <sys/ipc.h> +#include <sys/shm.h> #include <linux/io_uring.h> #include <liburing.h> -#include <linux/ublk_cmd.h> +#include <semaphore.h> + +/* allow ublk_dep.h to override ublk_cmd.h */ #include "ublk_dep.h" +#include <linux/ublk_cmd.h> #define __maybe_unused __attribute__((unused)) #define MAX_BACK_FILES 4 @@ -74,6 +79,10 @@ struct dev_ctx { unsigned int chunk_size; int _evtfd; + int _shmid; + + /* built from shmem, only for ublk_dump_dev() */ + struct ublk_dev *shadow_dev; }; struct ublk_ctrl_cmd_data { |
