block: add support for IO CPU affinity
This patch adds support for controlling the IO completion CPU of
either all requests on a queue, or on a per-request basis. We export
a sysfs variable (rq_affinity) which, if set, migrates completions
of requests to the CPU that originally submitted it. A bio helper
(bio_set_completion_cpu()) is also added, so that queuers can ask
for completion on that specific CPU.
In testing, this has been show to cut the system time by as much
as 20-40% on synthetic workloads where CPU affinity is desired.
This requires a little help from the architecture, so it'll only
work as designed for archs that are using the new generic smp
helper infrastructure.
Signed-off-by:
Jens Axboe <jens.axboe@oracle.com>
Showing
- block/blk-core.c 23 additions, 23 deletionsblock/blk-core.c
- block/blk-settings.c 1 addition, 1 deletionblock/blk-settings.c
- block/blk-softirq.c 95 additions, 31 deletionsblock/blk-softirq.c
- block/blk-sysfs.c 31 additions, 0 deletionsblock/blk-sysfs.c
- block/blk.h 12 additions, 0 deletionsblock/blk.h
- fs/bio.c 1 addition, 0 deletionsfs/bio.c
- include/linux/bio.h 11 additions, 0 deletionsinclude/linux/bio.h
- include/linux/blkdev.h 4 additions, 1 deletioninclude/linux/blkdev.h
- include/linux/elevator.h 4 additions, 4 deletionsinclude/linux/elevator.h
Please register or sign in to comment