public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>
Cc: Mark_H_Johnson@raytheon.com, Amit Shah <amit.shah@codito.com>,
	Karsten Wiese <annabellesgarden@yahoo.de>,
	Bill Huey <bhuey@lnxw.com>, Adam Heath <doogie@debian.org>,
	emann@mrv.com, Gunther Persoons <gunther_persoons@spymac.com>,
	"K.R. Foley" <kr@cybsft.com>,
	linux-kernel@vger.kernel.org,
	Florian Schmidt <mista.tapas@gmx.net>,
	Lee Revell <rlrevell@joe-job.com>,
	Rui Nuno Capela <rncbc@rncbc.org>,
	Shane Shrybman <shrybman@aei.ca>,
	Esben Nielsen <simlo@phys.au.dk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
Subject: Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15
Date: Mon, 13 Dec 2004 07:47:19 +0100	[thread overview]
Message-ID: <20041213064719.GA3681@elte.hu> (raw)
In-Reply-To: <1102897004.31218.8.camel@cmn37.stanford.edu>


* Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU> wrote:

> Something that just happened to me: running 0.7.32-14
> (PREEMPT_DESKTOP) and trying to install 0.7.32-19 from a custom built
> rpm package completely hangs the machine (p4 laptop - I tried twice).
> No clues left behind. If I boot into 0.7.32-9 I can install 0.7.32-19
> with no problems. 

does 0.7.32-19 work better if you reverse (patch -R) the loop.h and
loop.c bits (see below)?

	Ingo

--- linux/drivers/block/loop.c.orig
+++ linux/drivers/block/loop.c
@@ -378,7 +378,7 @@ static void loop_add_bio(struct loop_dev
 		lo->lo_bio = lo->lo_biotail = bio;
 	spin_unlock_irqrestore(&lo->lo_lock, flags);
 
-	up(&lo->lo_bh_mutex);
+	complete(&lo->lo_bh_done);
 }
 
 /*
@@ -427,7 +427,7 @@ static int loop_make_request(request_que
 	return 0;
 err:
 	if (atomic_dec_and_test(&lo->lo_pending))
-		up(&lo->lo_bh_mutex);
+		complete(&lo->lo_bh_done);
 out:
 	bio_io_error(old_bio, old_bio->bi_size);
 	return 0;
@@ -495,12 +495,12 @@ static int loop_thread(void *data)
 	/*
 	 * up sem, we are running
 	 */
-	up(&lo->lo_sem);
+	complete(&lo->lo_done);
 
 	for (;;) {
-		down_interruptible(&lo->lo_bh_mutex);
+		wait_for_completion_interruptible(&lo->lo_bh_done);
 		/*
-		 * could be upped because of tear-down, not because of
+		 * could be completed because of tear-down, not because of
 		 * pending work
 		 */
 		if (!atomic_read(&lo->lo_pending))
@@ -521,7 +521,7 @@ static int loop_thread(void *data)
 			break;
 	}
 
-	up(&lo->lo_sem);
+	complete(&lo->lo_done);
 	return 0;
 }
 
@@ -708,7 +708,7 @@ static int loop_set_fd(struct loop_devic
 	set_blocksize(bdev, lo_blocksize);
 
 	kernel_thread(loop_thread, lo, CLONE_KERNEL);
-	down(&lo->lo_sem);
+	wait_for_completion(&lo->lo_done);
 	return 0;
 
  out_putf:
@@ -773,10 +773,10 @@ static int loop_clr_fd(struct loop_devic
 	spin_lock_irq(&lo->lo_lock);
 	lo->lo_state = Lo_rundown;
 	if (atomic_dec_and_test(&lo->lo_pending))
-		up(&lo->lo_bh_mutex);
+		complete(&lo->lo_bh_done);
 	spin_unlock_irq(&lo->lo_lock);
 
-	down(&lo->lo_sem);
+	wait_for_completion(&lo->lo_done);
 
 	lo->lo_backing_file = NULL;
 
@@ -1153,8 +1153,8 @@ int __init loop_init(void)
 		if (!lo->lo_queue)
 			goto out_mem4;
 		init_MUTEX(&lo->lo_ctl_mutex);
-		init_MUTEX_LOCKED(&lo->lo_sem);
-		init_MUTEX_LOCKED(&lo->lo_bh_mutex);
+		init_completion(&lo->lo_done);
+		init_completion(&lo->lo_bh_done);
 		lo->lo_number = i;
 		spin_lock_init(&lo->lo_lock);
 		disk->major = LOOP_MAJOR;
--- linux/include/linux/loop.h.orig
+++ linux/include/linux/loop.h
@@ -58,9 +58,9 @@ struct loop_device {
 	struct bio 		*lo_bio;
 	struct bio		*lo_biotail;
 	int			lo_state;
-	struct semaphore	lo_sem;
+	struct completion	lo_done;
+	struct completion	lo_bh_done;
 	struct semaphore	lo_ctl_mutex;
-	struct semaphore	lo_bh_mutex;
 	atomic_t		lo_pending;
 
 	request_queue_t		*lo_queue;

  reply	other threads:[~2004-12-13  6:48 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-10 17:49 [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15 Mark_H_Johnson
2004-12-10 21:09 ` Ingo Molnar
2004-12-10 21:12 ` Ingo Molnar
2004-12-10 21:24 ` Ingo Molnar
2004-12-13  0:16 ` Fernando Lopez-Lezcano
2004-12-13  6:47   ` Ingo Molnar [this message]
2004-12-14  0:46     ` Fernando Lopez-Lezcano
2004-12-14  4:42       ` K.R. Foley
2004-12-14  8:47         ` Rui Nuno Capela
2004-12-14 11:35           ` Ingo Molnar
2004-12-27 14:35             ` Real-time rw-locks (Re: [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15) Esben Nielsen
2004-12-27 15:27               ` Steven Rostedt
2004-12-27 16:23                 ` Esben Nielsen
2004-12-27 16:39                   ` Steven Rostedt
2004-12-27 21:06                     ` Bill Huey
2004-12-27 21:48                       ` Valdis.Kletnieks
2004-12-28 21:59                       ` Lee Revell
2005-01-04 15:25                       ` Andrew McGregor
2004-12-28 21:42                   ` Lee Revell
2005-01-28  7:38               ` Ingo Molnar
2005-01-28 11:56                 ` William Lee Irwin III
2005-01-28 15:28                   ` Ingo Molnar
2005-01-28 15:55                     ` William Lee Irwin III
2005-01-28 16:16                       ` Ingo Molnar
2005-01-28 19:18                 ` Trond Myklebust
2005-01-28 19:45                   ` Ingo Molnar
2005-01-28 23:25                     ` Bill Huey
2005-01-28 21:13                   ` Lee Revell
2005-01-30 22:03                 ` Esben Nielsen
2005-01-30 23:59                   ` Kyle Moffett
  -- strict thread matches above, loose matches on Subject: below --
2004-12-13 23:14 [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15 Mark_H_Johnson
2004-12-13 20:02 Mark_H_Johnson
2004-12-13 22:39 ` Ingo Molnar
2004-12-13 17:05 Mark_H_Johnson
2004-12-13 22:33 ` Ingo Molnar
2004-12-10 22:06 Mark_H_Johnson
2004-12-10 22:24 ` Ingo Molnar
2004-12-10 21:58 Mark_H_Johnson
2004-12-10 21:54 Mark_H_Johnson
2004-12-10 22:14 ` Ingo Molnar
2004-12-10 21:31 Mark_H_Johnson
2004-12-10 21:54 ` Ingo Molnar
2004-12-10 21:06 Mark_H_Johnson
2004-12-10 21:40 ` Ingo Molnar
2004-12-10 20:03 Mark_H_Johnson
2004-12-09 21:58 [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-6 Mark_H_Johnson
2004-12-09 22:55 ` Ingo Molnar
2004-12-10 10:53   ` [patch] Real-Time Preemption, -RT-2.6.10-rc2-mm3-V0.7.32-15 Ingo Molnar
2004-12-10 14:59     ` Gene Heskett
2004-12-10 15:59       ` Gene Heskett
2004-12-10 19:09     ` Lee Revell

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=20041213064719.GA3681@elte.hu \
    --to=mingo@elte.hu \
    --cc=Mark_H_Johnson@raytheon.com \
    --cc=amit.shah@codito.com \
    --cc=annabellesgarden@yahoo.de \
    --cc=bhuey@lnxw.com \
    --cc=doogie@debian.org \
    --cc=emann@mrv.com \
    --cc=gunther_persoons@spymac.com \
    --cc=kr@cybsft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mista.tapas@gmx.net \
    --cc=nando@ccrma.Stanford.EDU \
    --cc=rlrevell@joe-job.com \
    --cc=rncbc@rncbc.org \
    --cc=shrybman@aei.ca \
    --cc=simlo@phys.au.dk \
    --cc=tglx@linutronix.de \
    --cc=xschmi00@stud.feec.vutbr.cz \
    /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