diff options
| author | Andrew Morton <akpm@osdl.org> | 2003-07-04 19:37:26 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-07-04 19:37:26 -0700 |
| commit | 930805a244eaadb5aefbc08b558db72136128388 (patch) | |
| tree | 8b760be8c4fee468172cf15c95d702974533d140 /include | |
| parent | 16f88dbdbffa3dc52b959706e6a311a932b51ed6 (diff) | |
[PATCH] block request batching
From: Nick Piggin <piggin@cyberone.com.au>
The following patch gets batching working how it should be.
After a process is woken up, it is allowed to allocate up to 32 requests
for 20ms. It does not stop other processes submitting requests if it isn't
submitting though. This should allow less context switches, and allow
batches of requests from each process to be sent to the io scheduler
instead of 1 request from each process.
tiobench sequential writes are more than tripled, random writes are nearly
doubled over mm1. In earlier tests I generally saw better CPU efficiency
but it doesn't show here. There is still debug to be taken out. Its also
only on UP.
Avg Maximum Lat% Lat% CPU
Identifier Rate (CPU%) Latency Latency >2s >10s Eff
------------------- ------ --------- ---------- ------- ------ ----
-2.5.71-mm1 11.13 3.783% 46.10 24668.01 0.84 0.02 294
+2.5.71-mm1 13.21 4.489% 37.37 5691.66 0.76 0.00 294
Random Reads
------------------- ------ --------- ---------- ------- ------ ----
-2.5.71-mm1 0.97 0.582% 519.86 6444.66 11.93 0.00 167
+2.5.71-mm1 1.01 0.604% 484.59 6604.93 10.73 0.00 167
Sequential Writes
------------------- ------ --------- ---------- ------- ------ ----
-2.5.71-mm1 4.85 4.456% 77.80 99359.39 0.18 0.13 109
+2.5.71-mm1 14.11 14.19% 10.07 22805.47 0.09 0.04 99
Random Writes
------------------- ------ --------- ---------- ------- ------ ----
-2.5.71-mm1 0.46 0.371% 14.48 6173.90 0.23 0.00 125
+2.5.71-mm1 0.86 0.744% 24.08 8753.66 0.31 0.00 115
It decreases context switch rate on IBM's 8-way on ext2 tiobench 64 threads
from ~2500/s to ~140/s on their regression tests.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/blkdev.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 13116a7a7969..69178ca80d7d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -59,6 +59,12 @@ struct io_context { atomic_t refcount; pid_t pid; + /* + * For request batching + */ + unsigned long last_waited; /* Time last woken after wait for request */ + int nr_batch_requests; /* Number of requests left in the batch */ + struct as_io_context *aic; }; |
