Re: help! locks problem in block layer request queue?

From: Jens Axboe
Date: Mon Feb 23 2009 - 02:20:46 EST



(please don't top post reply to emails...)

On Sat, Feb 21 2009, Gao, Yunpeng wrote:
> Really awesome! This is a big bug. I have re-write the code of
> processing requests from the request queue. The new code is copied
> from drivers/mtd/mtd_blkdevs.c and did some necessary modifies. Now it
> works well. Many thanks to you :)

Glad that it now works :-)

> BTW, I noticed that MTD driver (drivers/mtd/mtd_blkdevs.c) and MMC
> driver (drivers/mmc/card/block.c and queue.c) also register a block
> device, and they create a kernel thread to process the request queue
> instead of process it directly. Why they do it like that? Is there any
> special reason for that?

If your request handling is slow, then it is often better to push
request handling to a dedicated thread. That may be the case if your
device can't do DMA for instance, and you have to transfer all the data
manually. Pushing that to a thread usually makes it easy to do that with
interrupts enabled and is thus nicer to the rest of the system.

--
Jens Axboe

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