From: Mike Waychison <Michael.Waychison@Sun.COM>
To: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
Linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: wait_for_completion API extension addition
Date: Tue, 25 Jan 2005 18:47:13 -0500 [thread overview]
Message-ID: <41F6DA81.9000503@sun.com> (raw)
In-Reply-To: <20050125210102.GA6452@elte.hu>
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ingo Molnar wrote:
> * Mike Waychison <Michael.Waychison@Sun.COM> wrote:
>
>
>>Hi Ingo,
>>
>>I noticed that the wait_for_completion API extensions made it into
>>mainline.
>>
>>However, I posted that the patch in question is broken a while back:
>>
>>http://marc.theaimsgroup.com/?l=linux-kernel&m=110131832828126&w=2
>>
>>Can we fix this?
>
>
> (/me pokes himself in the eyes)
>
> could you send an incremental patch against BK-curr?
>
> Ingo
Attached.
- --
Mike Waychison
Sun Microsystems, Inc.
1 (650) 352-5299 voice
1 (416) 202-8336 voice
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTICE: The opinions expressed in this email are held by me,
and may not represent the views of Sun Microsystems, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB9tpBdQs4kOxk3/MRArUtAJ4+O7CCH8HdGqeREJb7yVQjOdJSkQCfRTIX
al9JVahdnQcOJIwyIW3LeDU=
=zhk+
-----END PGP SIGNATURE-----
[-- Attachment #2: fix_completion_api.patch --]
[-- Type: text/x-patch, Size: 2039 bytes --]
Fix up signal_pending and timeout paths for wait_for_completion API extensions.
Signed-off-by: Mike Waychison <michael.waychison@sun.com>
---
sched.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
Index: linux-2.6-bk-curr/kernel/sched.c
===================================================================
--- linux-2.6-bk-curr.orig/kernel/sched.c 2005-01-25 18:22:04.667957792 -0500
+++ linux-2.6-bk-curr/kernel/sched.c 2005-01-25 18:38:54.421451928 -0500
@@ -3020,15 +3020,17 @@ wait_for_completion_timeout(struct compl
__set_current_state(TASK_UNINTERRUPTIBLE);
spin_unlock_irq(&x->wait.lock);
timeout = schedule_timeout(timeout);
- if (!timeout)
- goto out;
spin_lock_irq(&x->wait.lock);
+ if (!timeout) {
+ __remove_wait_queue(&x->wait, &wait);
+ goto out;
+ }
} while (!x->done);
__remove_wait_queue(&x->wait, &wait);
}
x->done--;
- spin_unlock_irq(&x->wait.lock);
out:
+ spin_unlock_irq(&x->wait.lock);
return timeout;
}
EXPORT_SYMBOL(wait_for_completion_timeout);
@@ -3048,6 +3050,7 @@ int fastcall __sched wait_for_completion
do {
if (signal_pending(current)) {
ret = -ERESTARTSYS;
+ __remove_wait_queue(&x->wait, &wait);
goto out;
}
__set_current_state(TASK_INTERRUPTIBLE);
@@ -3080,21 +3083,23 @@ wait_for_completion_interruptible_timeou
do {
if (signal_pending(current)) {
timeout = -ERESTARTSYS;
- goto out_unlock;
+ __remove_wait_queue(&x->wait, &wait);
+ goto out;
}
__set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irq(&x->wait.lock);
timeout = schedule_timeout(timeout);
- if (!timeout)
- goto out;
spin_lock_irq(&x->wait.lock);
+ if (!timeout) {
+ __remove_wait_queue(&x->wait, &wait);
+ goto out;
+ }
} while (!x->done);
__remove_wait_queue(&x->wait, &wait);
}
x->done--;
-out_unlock:
- spin_unlock_irq(&x->wait.lock);
out:
+ spin_unlock_irq(&x->wait.lock);
return timeout;
}
EXPORT_SYMBOL(wait_for_completion_interruptible_timeout);
prev parent reply other threads:[~2005-01-25 23:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-25 20:22 wait_for_completion API extension addition Mike Waychison
2005-01-25 20:30 ` Thomas Gleixner
2005-01-25 20:41 ` Mike Waychison
2005-01-25 21:01 ` Ingo Molnar
2005-01-25 23:47 ` Mike Waychison [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=41F6DA81.9000503@sun.com \
--to=michael.waychison@sun.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.org \
/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