Re: Block device request merging - repeated requests.

From: Jens Axboe (axboe@suse.de)
Date: Mon Jan 31 2000 - 10:32:00 EST


On Mon, Jan 31 2000, David Woodhouse wrote:
> I'm playing with a new block device driver in 2.3.41
>
> When I try something simple like
> 'dd if=/dev/zero of=/dev/mydevice bs=512 count=10'
>
> ... I find that the requests are helpfully merged.
>
> Unfortunately, I find that they're also repeated.
>
> So - what was ten separate write requests, for each consecutive block, now
> becomes ten write requests, each for the whole ten.

There were some request changes in 2.3.41, but it should not make
a difference. My guess is that you are not handling clustered
requests correctly, but that is kind of hard to tell when you
don't show any code.

> Am I doing something wrong - when I'm passed a request should I be checking
> it to see if it's already uptodate?

No.

> Or is the block request combining code in 2.3.41 completely shagged?

No, definately not. Are you ending the requests correctly?

> By setting max_sectors to 1 for the device in question, effectively disabling
> the request merging, I return the system to sane behaviour.

You can also use your own request merging functions, ala

blk_init_queue(q, request_fn);
q->merge_fn = your_merge_fn;
q->merge_requests_fn = your_merge_reqeusts_fn;

and just say no to merging, if you like.

-- 
*  Jens Axboe <axboe@suse.de>
*  Linux CD-ROM Maintainer
*  http://www.kernel.dk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 31 2000 - 21:00:28 EST