Skip to contentSkip to conversation

2.5.66-mm2 with contest

BENCHMARK Con Kolivas 3 participants 7 messages Apr 2, 2003 Block layer

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Contest benchamarks for 2.5.66-mm2:

no_load:

Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   79      94.9    0.0     0.0     1.00
2.5.66-mm1          3   79      94.9    0.0     0.0     1.00
2.5.66-mm2          3   80      93.8    0.0     0.0     1.00
cacherun:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   76      98.7    0.0     0.0     0.96
2.5.66-mm1          3   75      100.0   0.0     0.0     0.95
2.5.66-mm2          3   75      100.0   0.0     0.0     0.94
process_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   241     30.7    311.0   68.0    3.05
2.5.66-mm1          3   240     30.8    295.3   67.9    3.04
2.5.66-mm2          3   239     31.0    295.3   67.8    2.99
ctar_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   105     74.3    0.0     0.0     1.33
2.5.66-mm1          3   110     70.9    1.0     5.5     1.39
2.5.66-mm2          3   184     42.9    2.0     7.1     2.30
xtar_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   105     72.4    1.0     3.8     1.33
2.5.66-mm1          3   104     74.0    1.0     3.8     1.32
2.5.66-mm2          3   108     71.3    1.3     4.6     1.35
io_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   438     17.8    150.4   20.9    5.54
2.5.66-mm1          3   132     58.3    45.8    18.9    1.67
2.5.66-mm2          3   371     21.0    147.9   22.3    4.64
io_other:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   158     49.4    70.0    27.2    2.00
2.5.66-mm1          3   134     58.2    57.5    23.7    1.70
2.5.66-mm2          3   136     57.4    56.7    22.8    1.70
read_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   110     70.9    6.2     4.5     1.39
2.5.66-mm1          3   121     65.3    9.2     5.8     1.53
2.5.66-mm2          3   110     71.8    8.4     6.3     1.38
list_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   97      79.4    0.0     7.2     1.23
2.5.66-mm1          3   97      80.4    0.0     7.2     1.23
2.5.66-mm2          3   96      80.2    0.0     7.3     1.20
mem_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   112     70.5    64.0    1.8     1.42
2.5.66-mm1          3   104     76.0    54.0    1.9     1.32
2.5.66-mm2          3   109     71.6    57.7    1.8     1.36
dbench_load:
Kernel         [runs]   Time    CPU%    Loads   LCPU%   Ratio
2.5.66              3   459     16.6    7.0     56.6    5.81
2.5.66-mm1          3   373     20.4    6.3     50.7    4.72
2.5.66-mm2          3   323     23.2    4.7     51.4    4.04

Big rise in ctar_load and io_load. Drop in read_load.
(All uniprocessor with IDE and AS elevator). AS tweaks? No obvious scheduler tweak result changes.

Con
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+ilfEF6dfvkL3i1gRAhjoAJ48yMQqJ0QTJHuzbpsWsQtgUShmEwCeOz3R IIgzmANSzpbtSagS9wnHAk8=
=BJqi
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 3 lines · Con Kolivas

Big rise in ctar_load and io_load. Drop in read_load.
(All uniprocessor with IDE and AS elevator). AS tweaks? No obvious scheduler tweak result changes.

Thanks Con,
I'm a bit busy now, but next week I'll work something out for it. It is most likely to be as-queue_notready-cleanup.patch. I'll wait until after Jens ports his dynamic requests stuff over to mm before I go further.

#2 lore raw
Quoted 11 lines · Nick Piggin
Quoted 4 lines · Con Kolivas

Big rise in ctar_load and io_load. Drop in read_load. (All uniprocessor with IDE and AS elevator). AS tweaks? No obvious scheduler tweak result changes.

Thanks Con,
I'm a bit busy now, but next week I'll work something out for it. It is most likely to be as-queue_notready-cleanup.patch. I'll wait until after Jens ports his dynamic requests stuff over to mm before I go further.

It is ported, I sent Andrew the patch yesterday. I'm attaching it here as well.

drivers/block/as-iosched.c renamed from opt/kernel/linux-2.5.66-mm2/drivers/block/as-iosched.c +46 -48
diff -ur -X /home/axboe/cdrom/exclude /opt/kernel/linux-2.5.66-mm2/drivers/block/as-iosched.c linux-2.5.66-mm2/drivers/block/as-iosched.c
@@ -117,6 +117,7 @@
 	unsigned long current_batch_expires;
 	unsigned long last_check_fifo[2];
 	int batch_data_dir;		/* current/last batch READ or WRITE */
+	mempool_t *arq_pool;
 
 	int antic_status;
 	unsigned long antic_start;	/* jiffies: when it started */
@@ -1461,12 +1462,42 @@
 	spin_unlock_irqrestore(q->queue_lock, flags);
 }
 
+static void as_put_request(request_queue_t *q, struct request *rq)
+{
+	struct as_data *ad = q->elevator.elevator_data;
+	struct as_rq *arq = RQ_DATA(rq);
+
+	if (arq) {
+		mempool_free(arq, ad->arq_pool);
+		rq->elevator_private = NULL;
+	}
+}
+
+static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
+{
+	struct as_data *ad = q->elevator.elevator_data;
+	struct as_rq *arq = mempool_alloc(ad->arq_pool, gfp_mask);
+
+	if (arq) {
+		RB_CLEAR(&arq->rb_node);
+		arq->request = rq;
+
+		arq->as_io_context = NULL;
+		INIT_LIST_HEAD(&arq->hash);
+		arq->hash_valid_count = 0;
+
+		INIT_LIST_HEAD(&arq->fifo);
+
+		rq->elevator_private = arq;
+		return 0;
+	}
+
+	return 1;
+}
+
 static void as_exit(request_queue_t *q, elevator_t *e)
 {
 	struct as_data *ad = e->elevator_data;
-	struct as_rq *arq;
-	struct request *rq;
-	int i;
 
 	del_timer_sync(&ad->antic_timer);
 	kblockd_flush();
@@ -1474,21 +1505,7 @@
 	BUG_ON(!list_empty(&ad->fifo_list[READ]));
 	BUG_ON(!list_empty(&ad->fifo_list[WRITE]));
 
-	for (i = READ; i <= WRITE; i++) {
-		struct request_list *rl = &q->rq[i];
-		struct list_head *entry;
-
-		list_for_each(entry, &rl->free) {
-			rq = list_entry_rq(entry);
-
-			if ((arq = RQ_DATA(rq)) == NULL)
-				continue;
-
-			rq->elevator_private = NULL;
-			kmem_cache_free(arq_pool, arq);
-		}
-	}
-
+	mempool_destroy(ad->arq_pool);
 	put_as_io_context(&ad->as_io_context);
 	kfree(ad->hash);
 	kfree(ad);
@@ -1501,9 +1518,7 @@
 static int as_init(request_queue_t *q, elevator_t *e)
 {
 	struct as_data *ad;
-	struct as_rq *arq;
-	struct request *rq;
-	int i, ret = 0;
+	int i;
 
 	if (!arq_pool)
 		return -ENOMEM;
@@ -1521,6 +1536,13 @@
 		return -ENOMEM;
 	}
 
+	ad->arq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, arq_pool);
+	if (!ad->arq_pool) {
+		kfree(ad->hash);
+		kfree(ad);
+		return -ENOMEM;
+	}
+
 	/* anticipatory scheduling helpers */
 	ad->antic_timer.function = as_antic_timeout;
 	ad->antic_timer.data = (unsigned long)q;
@@ -1544,33 +1566,7 @@
 	e->elevator_data = ad;
 
 	ad->current_batch_expires = jiffies + ad->batch_expire[READ];
-
-	for (i = READ; i <= WRITE; i++) {
-		struct request_list *rl = &q->rq[i];
-		struct list_head *entry;
-
-		list_for_each(entry, &rl->free) {
-			rq = list_entry_rq(entry);
-
-			arq = kmem_cache_alloc(arq_pool, GFP_KERNEL);
-			if (!arq) {
-				ret = -ENOMEM;
-				break;
-			}
-
-			memset(arq, 0, sizeof(*arq));
-			INIT_LIST_HEAD(&arq->fifo);
-			INIT_LIST_HEAD(&arq->hash);
-			RB_CLEAR(&arq->rb_node);
-			arq->request = rq;
-			rq->elevator_private = arq;
-		}
-	}
-
-	if (ret)
-		as_exit(q, e);
-
-	return ret;
+	return 0;
 }
 
 /*
@@ -1723,6 +1719,8 @@
 	.elevator_queue_empty_fn =	as_queue_notready,
 	.elevator_former_req_fn =	as_former_request,
 	.elevator_latter_req_fn =	as_latter_request,
+	.elevator_set_req_fn =		as_set_request,
+	.elevator_put_req_fn =		as_put_request,
 	.elevator_init_fn =		as_init,
 	.elevator_exit_fn =		as_exit,
 
drivers/block/cfq-iosched.c renamed from opt/kernel/linux-2.5.66-mm2/drivers/block/cfq-iosched.c +39 -54

144 lines not on this page · raw message

drivers/block/deadline-iosched.c renamed from opt/kernel/linux-2.5.66-mm2/drivers/block/deadline-iosched.c +60 -44

167 lines not on this page · raw message

drivers/block/elevator.c renamed from opt/kernel/linux-2.5.66-mm2/drivers/block/elevator.c +19 -0
diff -ur -X /home/axboe/cdrom/exclude /opt/kernel/linux-2.5.66-mm2/drivers/block/elevator.c linux-2.5.66-mm2/drivers/block/elevator.c
@@ -418,6 +418,25 @@
 	return 1;
 }
 
+int elv_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
+{
+	elevator_t *e = &q->elevator;
+
+	if (e->elevator_set_req_fn)
+		return e->elevator_set_req_fn(q, rq, gfp_mask);
+
+	rq->elevator_private = NULL;
+	return 0;
+}
+
+void elv_put_request(request_queue_t *q, struct request *rq)
+{
+	elevator_t *e = &q->elevator;
+
+	if (e->elevator_put_req_fn)
+		e->elevator_put_req_fn(q, rq);
+}
+
 int elv_register_queue(struct gendisk *disk)
 {
 	request_queue_t *q = disk->queue;
drivers/block/ll_rw_blk.c renamed from opt/kernel/linux-2.5.66-mm2/drivers/block/ll_rw_blk.c +71 -166

397 lines not on this page · raw message

include/linux/blkdev.h renamed from opt/kernel/linux-2.5.66-mm2/include/linux/blkdev.h +7 -5
diff -ur -X /home/axboe/cdrom/exclude /opt/kernel/linux-2.5.66-mm2/include/linux/blkdev.h linux-2.5.66-mm2/include/linux/blkdev.h
@@ -10,6 +10,7 @@
 #include <linux/pagemap.h>
 #include <linux/backing-dev.h>
 #include <linux/wait.h>
+#include <linux/mempool.h>
 
 #include <asm/scatterlist.h>
 
@@ -18,10 +19,12 @@
 struct elevator_s;
 typedef struct elevator_s elevator_t;
 
+#define BLKDEV_MIN_RQ	4
+#define BLKDEV_MAX_RQ	1024
+
 struct request_list {
-	unsigned int count;
-	struct list_head free;
-	wait_queue_head_t wait;
+	int count[2];
+	mempool_t *rq_pool;
 };
 
 /*
@@ -180,7 +183,7 @@
 	/*
 	 * the queue request freelist, one for reads and one for writes
 	 */
-	struct request_list	rq[2];
+	struct request_list	rq;
 
 	request_fn_proc		*request_fn;
 	merge_request_fn	*back_merge_fn;
@@ -330,7 +333,6 @@
 extern void blk_attempt_remerge(request_queue_t *, struct request *);
 extern void __blk_attempt_remerge(request_queue_t *, struct request *);
 extern struct request *blk_get_request(request_queue_t *, int, int);
-extern struct request *__blk_get_request(request_queue_t *, int);
 extern void blk_put_request(struct request *);
 extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
 extern void blk_plug_device(request_queue_t *);
include/linux/elevator.h renamed from opt/kernel/linux-2.5.66-mm2/include/linux/elevator.h +7 -0
diff -ur -X /home/axboe/cdrom/exclude /opt/kernel/linux-2.5.66-mm2/include/linux/elevator.h linux-2.5.66-mm2/include/linux/elevator.h
@@ -16,6 +16,8 @@
 typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
 typedef struct list_head *(elevator_get_sort_head_fn) (request_queue_t *, struct request *);
 typedef int (elevator_may_queue_fn) (request_queue_t *, int);
+typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, int);
+typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
 
 typedef int (elevator_init_fn) (request_queue_t *, elevator_t *);
 typedef void (elevator_exit_fn) (request_queue_t *, elevator_t *);
@@ -35,6 +37,9 @@
 	elevator_request_list_fn *elevator_former_req_fn;
 	elevator_request_list_fn *elevator_latter_req_fn;
 
+	elevator_set_req_fn *elevator_set_req_fn;
+	elevator_put_req_fn *elevator_put_req_fn;
+
 	elevator_may_queue_fn *elevator_may_queue_fn;
 
 	elevator_init_fn *elevator_init_fn;
@@ -62,6 +67,8 @@
 extern int elv_register_queue(struct gendisk *);
 extern void elv_unregister_queue(struct gendisk *);
 extern int elv_may_queue(request_queue_t *, int);
+extern int elv_set_request(request_queue_t *, struct request *, int);
+extern void elv_put_request(request_queue_t *, struct request *);
 
 #define __elv_add_request_pos(q, rq, pos)	\
 	(q)->elevator.elevator_add_req_fn((q), (rq), (pos))
Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 16 lines · Jens Axboe
Quoted 7 lines · Nick Piggin
Quoted 4 lines · Con Kolivas

Big rise in ctar_load and io_load. Drop in read_load.
(All uniprocessor with IDE and AS elevator). AS tweaks? No obvious scheduler tweak result changes.

Quoted 6 lines

Thanks Con,
I'm a bit busy now, but next week I'll work something out for it. It is most likely to be as-queue_notready-cleanup.patch. I'll wait until after Jens ports his dynamic requests stuff over to mm before I go further.

Quoted 3 lines

It is ported, I sent Andrew the patch yesterday. I'm attaching it here as well.

Thanks for doing that, Jens. Any CPU measurements on the hash goodness that you did for deadline?

#4 lore raw
Quoted 19 lines · Nick Piggin
Quoted 17 lines · Jens Axboe
Quoted 14 lines · Nick Piggin
Quoted 5 lines · Con Kolivas

Big rise in ctar_load and io_load. Drop in read_load. (All uniprocessor with IDE and AS elevator). AS tweaks? No obvious scheduler tweak result changes.

Thanks Con,
I'm a bit busy now, but next week I'll work something out for it. It is most likely to be as-queue_notready-cleanup.patch. I'll wait until after Jens ports his dynamic requests stuff over to mm before I go further.

Quoted 5 lines
Quoted 3 lines

It is ported, I sent Andrew the patch yesterday. I'm attaching it here as well.

Thanks for doing that, Jens. Any CPU measurements on the hash goodness that you did for deadline?

Nope none yet, in fact Andrew's profile numbers show very little time spent inside the io scheduler hash as it is. It feels like the right thing to do though, even if the hash doesn't eat that much time.

Signature · 1 line
Jens Axboe
#5 lore raw
Quoted 10 lines · Jens Axboe
Quoted 3 lines · Nick Piggin

Thanks for doing that, Jens. Any CPU measurements on the hash goodness that you did for deadline?

Nope none yet, in fact Andrew's profile numbers show very little time spent inside the io scheduler hash as it is. It feels like the right thing to do though, even if the hash doesn't eat that much time.

I agree - especially as we want a smaller hash and with more requests.

#6 lore raw
Quoted 8 lines · Nick Piggin
Quoted 6 lines · Jens Axboe
Quoted 3 lines · Nick Piggin

Thanks for doing that, Jens. Any CPU measurements on the hash goodness that you did for deadline?

Quoted 6 lines
Quoted 4 lines

Nope none yet, in fact Andrew's profile numbers show very little time spent inside the io scheduler hash as it is. It feels like the right thing to do though, even if the hash doesn't eat that much time.

I agree - especially as we want a smaller hash and with more requests.

Exactly. The effectiveness of the last merge hint shows that the majority of the merges happen in succession, so the move-to-front for last merge should have obvious benefits.

The rq-dyn-alloc patch shrinks the hash to 32 entries as a consequence.

Signature · 1 line
Jens Axboe