summaryrefslogtreecommitdiff
path: root/rust/kernel/mm.rs
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2025-11-01 21:31:20 +0800
committerJens Axboe <axboe@kernel.dk>2025-11-03 08:34:59 -0700
commit3f5b1169d2ab20ed14271654799121232b9eb9d7 (patch)
treeeb3b50573f8bd81e36ee435cd7dbbe619f03ba9d /rust/kernel/mm.rs
parent0123bb91f464487cc1bbdcc515757dc723496a39 (diff)
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>
Diffstat (limited to 'rust/kernel/mm.rs')
0 files changed, 0 insertions, 0 deletions