Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 7 Mar 2002 04:13:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 7 Mar 2002 04:13:23 -0500 Received: from web10507.mail.yahoo.com ([216.136.130.157]:16393 "HELO web10507.mail.yahoo.com") by vger.kernel.org with SMTP id ; Thu, 7 Mar 2002 04:13:11 -0500 Message-ID: <20020307091311.16356.qmail@web10507.mail.yahoo.com> Date: Thu, 7 Mar 2002 01:13:11 -0800 (PST) From: Andy Tai Reply-To: atai@atai.org Subject: "layered" block devices and deadlock problems To: linux-kernel@vger.kernel.org Cc: atai@atai.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have been trying to write a kernel driver for a "layered" block device, that is, a virtual device which sits on top of actual physical devices and redirects read/write requests to them. To avoid problems in the interrupt context I save the requests in a queue in the request function and have a kernel thread pulling the requests out of the queue and then in turn calling read() or write() functions of the physical block device. However, I keep running into deadlocks. Sometimes the kernel thread will hang on waiting for free request structures. Other times it will hang in wait_for_buffer() in buffer.c. In both cases the system won't respond to any new shell commands I typed in. (But existing processes like xosview and top continue to run) Since I am not familiar with the internal workings of the buffer cache, can anyone give me hints on how to avoid deadlocks in layered drivers? Or pointers to useful documentation for this kind of tasks are also appreciated. Thanks. __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/