Skip to content

Commit

Permalink
NBD: make nbd default to deadline I/O scheduler
Browse files Browse the repository at this point in the history
NBD doesn't work well with CFQ (or AS) schedulers, so let's default to
something else.

The two problems I have experienced with nbd and cfq are:

1) nbd hangs with cfq on RHEL 5 (2.6.18) -- this may well have been
   fixed

   There's a similar debian bug that has been filed as well:

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=447638

   There have been posts to nbd-general mailing list about problems with
   cfq and nbd also.

2) nbd performs about 10% better (the last time I tested) with deadline
   vs.  cfq (the overhead of cfq doesn't provide much advantage to nbd [not
   being a real disk], and you end up going through the I/O scheduler on
   the nbd server anyway, so it makes sense that deadline is better with
   nbd)

Signed-off-by: Paul Clements <paul.clements@steeleye.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Paul Clements authored and Linus Torvalds committed Feb 24, 2008
1 parent 2f56deb commit 48f15b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ static int __init nbd_init(void)

for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1);
elevator_t *old_e;
if (!disk)
goto out;
nbd_dev[i].disk = disk;
Expand All @@ -668,6 +669,11 @@ static int __init nbd_init(void)
put_disk(disk);
goto out;
}
old_e = disk->queue->elevator;
if (elevator_init(disk->queue, "deadline") == 0 ||
elevator_init(disk->queue, "noop") == 0) {
elevator_exit(old_e);
}
}

if (register_blkdev(NBD_MAJOR, "nbd")) {
Expand Down

0 comments on commit 48f15b9

Please sign in to comment.