History

[PATCH] [BLOCK] cfq-iosched: change cfq io context linking from list to tree

On setups with many disks, we spend a considerable amount of time looking up the process-disk mapping on each queue of io. Testing with a NULL based block driver, this costs 40-50% reduction in throughput for 1000 disks.

Jens Axboe committed 20 years ago

Commit e2d74ac1 parent 329b10b3 files · +114 −124Browse files

Showing the changes to include/linux/blkdev.h (1 of 3 files). Show all

Unified · Split

include/linux/blkdev.h+6−8
@@ -55,13 +55,11 @@ struct as_io_context { · 54 unmodified lines
5555
5656 struct cfq_queue;
5757 struct cfq_io_context {
58− /*
59− * circular list of cfq_io_contexts belonging to a process io context
60− */
61− struct list_head list;
62− struct cfq_queue *cfqq[2];
58+ struct rb_node rb_node;
6359 void *key;
6460
61+ struct cfq_queue *cfqq[2];
62+
6563 struct io_context *ioc;
6664
6765 unsigned long last_end_request;
@@ -72,8 +70,8 @@ struct cfq_io_context { · 4 unmodified lines
7270
7371 struct list_head queue_list;
7472
75− void (*dtor)(struct cfq_io_context *);
76− void (*exit)(struct cfq_io_context *);
73+ void (*dtor)(struct io_context *); /* destructor */
74+ void (*exit)(struct io_context *); /* called on task exit */
7775 };
7876
7977 /*
@@ -94,7 +92,7 @@ struct io_context { · 14 unmodified lines
9492 int nr_batch_requests; /* Number of requests left in the batch */
9593
9694 struct as_io_context *aic;
97− struct cfq_io_context *cic;
95+ struct rb_root cic_root;
9896 };
9997
10098 void put_io_context(struct io_context *ioc);