[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090223071802.GK29783@kernel.dk>
Date: Mon, 23 Feb 2009 08:18:02 +0100
From: Jens Axboe <jens.axboe@...cle.com>
To: "Gao, Yunpeng" <yunpeng.gao@...el.com>
Cc: "linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: help! locks problem in block layer request queue?
(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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists