From: Jens Axboe <axboe@suse.de>
To: blaisorblade_spam@yahoo.it
Cc: akpm@osdl.org, jdike@addtoit.com, linux-kernel@vger.kernel.org,
user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [patch 1/1] uml:fix ubd deadlock on SMP
Date: Thu, 9 Sep 2004 09:35:23 +0200 [thread overview]
Message-ID: <20040909073523.GH1737@suse.de> (raw)
In-Reply-To: <20040908172503.384144933@zion.localdomain>
On Wed, Sep 08 2004, blaisorblade_spam@yahoo.it wrote:
> diff -puN arch/um/drivers/ubd_kern.c~uml-fix-ubd-deadlock arch/um/drivers/ubd_kern.c
> --- uml-linux-2.6.8.1/arch/um/drivers/ubd_kern.c~uml-fix-ubd-deadlock 2004-09-08 19:04:27.662926344 +0200
> +++ uml-linux-2.6.8.1-paolo/arch/um/drivers/ubd_kern.c 2004-09-08 19:05:36.700431048 +0200
> @@ -54,6 +54,7 @@
> #include "mem.h"
> #include "mem_kern.h"
>
> +/*This is the queue lock. FIXME: make it per-UBD device.*/
> static spinlock_t ubd_io_lock = SPIN_LOCK_UNLOCKED;
> static spinlock_t ubd_lock = SPIN_LOCK_UNLOCKED;
probably not worth it to make it per-device. doing so should be a simple
search-replace job, though.
> @@ -396,14 +397,16 @@ int thread_fd = -1;
> */
> int intr_count = 0;
>
> -static void ubd_finish(struct request *req, int error)
> +static inline void __ubd_finish(struct request *req, int error, int lock)
> {
> int nsect;
>
> if(error){
> - spin_lock(&ubd_io_lock);
> + if (lock)
> + spin_lock(&ubd_io_lock);
> end_request(req, 0);
> - spin_unlock(&ubd_io_lock);
> + if (lock)
> + spin_unlock(&ubd_io_lock);
In general, doing it this way is throwned upon. Either split the
function, or just make the callers acquire the lock if they have to.
--
Jens Axboe
prev parent reply other threads:[~2004-09-09 7:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-08 17:25 [patch 1/1] uml:fix ubd deadlock on SMP blaisorblade_spam
2004-09-08 18:12 ` Chris Wright
2004-09-09 18:02 ` [uml-devel] " BlaisorBlade
2004-09-09 18:32 ` Chris Wright
2004-09-09 18:44 ` BlaisorBlade
2004-09-09 19:29 ` Chris Wright
2004-09-10 19:01 ` BlaisorBlade
2004-09-09 7:35 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040909073523.GH1737@suse.de \
--to=axboe@suse.de \
--cc=akpm@osdl.org \
--cc=blaisorblade_spam@yahoo.it \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox