mirror-linux/tools/testing/selftests
Ming Lei 3f5b1169d2 selftests: ublk: make ublk_thread thread-local variable
Refactor ublk_thread to be a thread-local variable instead of storing
it in ublk_dev:

- Remove pthread_t thread field from struct ublk_thread and move it to
  struct ublk_thread_info

- Remove struct ublk_thread array from struct ublk_dev, reducing memory
  footprint

- Define struct ublk_thread as local variable in __ublk_io_handler_fn()
  instead of accessing it from dev->threads[]

- Extract main IO handling logic into __ublk_io_handler_fn() which is
  marked as noinline

- Move CPU affinity setup to ublk_io_handler_fn() before calling
  __ublk_io_handler_fn()

- Update ublk_thread_set_sched_affinity() to take struct ublk_thread_info *
  instead of struct ublk_thread *, and use pthread_setaffinity_np()
  instead of sched_setaffinity()

- Reorder struct ublk_thread fields to group related state together

This change makes each thread's ublk_thread structure truly local to
the thread, improving cache locality and reducing memory usage.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2025-11-03 08:34:59 -07:00
..
acct
alsa selftests/alsa: remove 0/NULL global variable assignment 2025-08-22 08:20:45 +02:00
amd-pstate
arm64 nolibc changes for v6.18 2025-09-30 19:18:17 -07:00
bpf selftests/bpf: Fix redefinition of 'off' as different kind of symbol 2025-10-17 11:33:23 -07:00
breakpoints
cachestat selftests: cachestat: add tests for mmap, refactor and enhance mmap test for cachestat validation 2025-08-02 12:06:09 -07:00
capabilities
cgroup selftests: cgroup: Make test_pids backwards compatible 2025-08-27 05:59:52 -10:00
clone3
connector
core
coredump selftests/coredump: Remove the read() that fails the test 2025-08-11 15:43:31 +02:00
cpu-hotplug
cpufreq
damon selftests/damon/access_memory_even: remove unused header file 2025-09-13 16:55:02 -07:00
devices
dma
dmabuf-heaps
drivers selftests: drv-net: update remaining Python init files 2025-10-12 19:03:53 +01:00
dt
efivarfs
exec
fchmodat2
filelock
filesystems Char/Misc/IIO/Binder changes for 6.18-rc1 2025-10-04 16:26:32 -07:00
firmware
fpu
ftrace Probes updates for v6.17: 2025-07-30 15:38:01 -07:00
futex selftest/futex: Fix spelling mistake "boundarie" -> "boundary" 2025-09-20 18:23:13 +02:00
gpio
hid selftests/hid: add tests for missing release on the Dell Synaptics 2025-10-15 17:27:06 +02:00
ia64
intel_pstate
iommu iommu/selftest: prevent use of uninitialized variable 2025-09-26 10:00:27 -03:00
ipc
ir
kcmp
kexec selftests/kexec: Ignore selftest binary 2025-09-25 13:43:28 -06:00
kho selftest/kho: update generation of initrd 2025-09-13 16:54:55 -07:00
kmod
kselftest
kselftest_harness selftests/kselftest_harness: Add harness-selftest.expected to TEST_FILES 2025-09-16 18:05:03 -06:00
kvm KVM x86 fixes for 6.18: 2025-10-18 10:25:43 +02:00
landlock selftests: centralise maybe-unused definition in kselftest.h 2025-09-13 16:55:16 -07:00
lib
livepatch
lkdtm
locking
lsm
media_tests
membarrier
memfd
memory-hotplug
mincore
mm selftests/mm: add fork inheritance test for ksm_merging_pages counter 2025-09-28 11:51:32 -07:00
module
mount
mount_setattr selftests/mount_setattr: add smoke tests for open_tree_attr(2) bug 2025-08-11 14:51:49 +02:00
move_mount_set_group
mqueue
mseal_system_mappings
namespaces selftests/namespaces: verify initial namespace inode numbers 2025-09-19 16:22:38 +02:00
nci
net selftests: tls: add test for short splice due to full skmsg 2025-10-15 17:41:46 -07:00
nolibc selftests/nolibc: remove outdated comment about construct order 2025-09-01 20:48:41 +02:00
ntb
openat2
pci_endpoint selftests: pci_endpoint: Skip IRQ test if IRQ is out of range. 2025-08-27 18:41:00 +05:30
pcie_bwctrl
perf_events selftests: centralise maybe-unused definition in kselftest.h 2025-09-13 16:55:16 -07:00
pid_namespace
pidfd vdso: Drop Kconfig GENERIC_VDSO_TIME_NS 2025-09-04 11:23:50 +02:00
power_supply
powerpc powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-09-01 13:23:29 +05:30
prctl
proc Patch series in this pull request: 2025-10-02 18:44:54 -07:00
pstore
ptp
ptrace Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
rcutorture torture: Add --do-normal parameter to torture.sh help text 2025-08-14 15:26:30 -07:00
resctrl
ring-buffer
riscv selftests: riscv: Add README for RISC-V KSelfTest 2025-09-18 19:26:07 -06:00
rlimits
rseq guest_memfd: 2025-10-04 08:52:16 -07:00
rtc
rust
safesetid
sched
sched_ext selftests/sched_ext: Remove duplicate sched.h header 2025-08-11 08:24:08 -10:00
seccomp Performance events updates for v6.18: 2025-09-30 11:11:21 -07:00
sgx
signal
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing selftests/tc-testing: Adapt tc police action tests for Gb rounding changes 2025-09-15 16:13:13 -07:00
tdx
thermal/intel thermal: intel: selftests: workload_hint: Mask unsupported types 2025-09-04 22:17:47 +02:00
timens
timers
tmpfs
tpm2
tty
turbostat
ublk selftests: ublk: make ublk_thread thread-local variable 2025-11-03 08:34:59 -07:00
uevent
user_events
vDSO selftests: vDSO: Drop vdso_test_clock_getres 2025-09-09 10:57:39 +02:00
vfio vfio: selftests: Fix .gitignore for already tracked files 2025-08-28 13:40:51 -06:00
vsock
watchdog selftests: watchdog: skip ping loop if WDIOF_KEEPALIVEPING not supported 2025-09-16 16:55:04 -06:00
wireguard wireguard: selftests: remove CONFIG_SPARSEMEM_VMEMMAP=y from qemu kernel config 2025-09-21 14:22:01 -07:00
x86
zram mm: remove unused zpool layer 2025-09-21 14:21:59 -07:00
.gitignore
Makefile VFIO updates for v6.18-rc1 2025-10-04 08:24:54 -07:00
gen_kselftest_tar.sh
kselftest.h Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
kselftest_deps.sh
kselftest_harness.h A set of updates for futexes and related selftests: 2025-09-30 16:07:10 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: always install UAPI headers to the correct directory 2025-09-18 12:05:27 -06:00
run_kselftest.sh