diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-09-13 14:26:01 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:09 -0400 |
commit | c7c22e4d5c1fdebfac4dba76de7d0338c2b0d832 (patch) | |
tree | ecc3d2517b3471ccc35d4cb4e3b48d4b57205061 /fs | |
parent | 18887ad910e56066233a07fd3cfb2fa11338b782 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bio.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -111,6 +111,7 @@ void bio_init(struct bio *bio) | |||
111 | { | 111 | { |
112 | memset(bio, 0, sizeof(*bio)); | 112 | memset(bio, 0, sizeof(*bio)); |
113 | bio->bi_flags = 1 << BIO_UPTODATE; | 113 | bio->bi_flags = 1 << BIO_UPTODATE; |
114 | bio->bi_comp_cpu = -1; | ||
114 | atomic_set(&bio->bi_cnt, 1); | 115 | atomic_set(&bio->bi_cnt, 1); |
115 | } | 116 | } |
116 | 117 | ||