* [RFC: 2.6 patch] kernel/sched.c: remove two unused functions
@ 2005-05-06 22:20 Adrian Bunk
0 siblings, 0 replies; 4+ messages in thread
From: Adrian Bunk @ 2005-05-06 22:20 UTC (permalink / raw)
To: linux-kernel
This patch removes the unused functions wait_for_completion_timeout and
wait_for_completion_interruptible_timeout.
Is any usage for them planned or is this patch OK?
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
include/linux/completion.h | 4 --
kernel/sched.c | 66 -------------------------------------
2 files changed, 70 deletions(-)
--- linux-2.6.12-rc3-mm2-full/include/linux/completion.h.old 2005-05-03 07:52:14.000000000 +0200
+++ linux-2.6.12-rc3-mm2-full/include/linux/completion.h 2005-05-03 07:52:32.000000000 +0200
@@ -29,10 +29,6 @@
extern void FASTCALL(wait_for_completion(struct completion *));
extern int FASTCALL(wait_for_completion_interruptible(struct completion *x));
-extern unsigned long FASTCALL(wait_for_completion_timeout(struct completion *x,
- unsigned long timeout));
-extern unsigned long FASTCALL(wait_for_completion_interruptible_timeout(
- struct completion *x, unsigned long timeout));
extern void FASTCALL(complete(struct completion *));
extern void FASTCALL(complete_all(struct completion *));
--- linux-2.6.12-rc3-mm2-full/kernel/sched.c.old 2005-05-03 07:52:42.000000000 +0200
+++ linux-2.6.12-rc3-mm2-full/kernel/sched.c 2005-05-03 07:53:03.000000000 +0200
@@ -3146,36 +3146,6 @@
}
EXPORT_SYMBOL(wait_for_completion);
-unsigned long fastcall __sched
-wait_for_completion_timeout(struct completion *x, unsigned long timeout)
-{
- might_sleep();
-
- spin_lock_irq(&x->wait.lock);
- if (!x->done) {
- DECLARE_WAITQUEUE(wait, current);
-
- wait.flags |= WQ_FLAG_EXCLUSIVE;
- __add_wait_queue_tail(&x->wait, &wait);
- do {
- __set_current_state(TASK_UNINTERRUPTIBLE);
- spin_unlock_irq(&x->wait.lock);
- timeout = schedule_timeout(timeout);
- 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:
- spin_unlock_irq(&x->wait.lock);
- return timeout;
-}
-EXPORT_SYMBOL(wait_for_completion_timeout);
-
int fastcall __sched wait_for_completion_interruptible(struct completion *x)
{
int ret = 0;
@@ -3209,42 +3179,6 @@
}
EXPORT_SYMBOL(wait_for_completion_interruptible);
-unsigned long fastcall __sched
-wait_for_completion_interruptible_timeout(struct completion *x,
- unsigned long timeout)
-{
- might_sleep();
-
- spin_lock_irq(&x->wait.lock);
- if (!x->done) {
- DECLARE_WAITQUEUE(wait, current);
-
- wait.flags |= WQ_FLAG_EXCLUSIVE;
- __add_wait_queue_tail(&x->wait, &wait);
- do {
- if (signal_pending(current)) {
- timeout = -ERESTARTSYS;
- __remove_wait_queue(&x->wait, &wait);
- goto out;
- }
- __set_current_state(TASK_INTERRUPTIBLE);
- spin_unlock_irq(&x->wait.lock);
- timeout = schedule_timeout(timeout);
- 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:
- spin_unlock_irq(&x->wait.lock);
- return timeout;
-}
-EXPORT_SYMBOL(wait_for_completion_interruptible_timeout);
-
#define SLEEP_ON_VAR \
unsigned long flags; \
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC: 2.6 patch] kernel/sched.c: remove two unused functions
@ 2005-05-13 0:47 Adrian Bunk
2005-05-13 6:48 ` Ingo Molnar
2005-05-14 5:35 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Adrian Bunk @ 2005-05-13 0:47 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
This patch removes the unused functions wait_for_completion_timeout and
wait_for_completion_interruptible_timeout.
Is any usage for them planned or is this patch OK?
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 7 May 2005
include/linux/completion.h | 4 --
kernel/sched.c | 66 -------------------------------------
2 files changed, 70 deletions(-)
--- linux-2.6.12-rc3-mm2-full/include/linux/completion.h.old 2005-05-03 07:52:14.000000000 +0200
+++ linux-2.6.12-rc3-mm2-full/include/linux/completion.h 2005-05-03 07:52:32.000000000 +0200
@@ -29,10 +29,6 @@
extern void FASTCALL(wait_for_completion(struct completion *));
extern int FASTCALL(wait_for_completion_interruptible(struct completion *x));
-extern unsigned long FASTCALL(wait_for_completion_timeout(struct completion *x,
- unsigned long timeout));
-extern unsigned long FASTCALL(wait_for_completion_interruptible_timeout(
- struct completion *x, unsigned long timeout));
extern void FASTCALL(complete(struct completion *));
extern void FASTCALL(complete_all(struct completion *));
--- linux-2.6.12-rc3-mm2-full/kernel/sched.c.old 2005-05-03 07:52:42.000000000 +0200
+++ linux-2.6.12-rc3-mm2-full/kernel/sched.c 2005-05-03 07:53:03.000000000 +0200
@@ -3146,36 +3146,6 @@
}
EXPORT_SYMBOL(wait_for_completion);
-unsigned long fastcall __sched
-wait_for_completion_timeout(struct completion *x, unsigned long timeout)
-{
- might_sleep();
-
- spin_lock_irq(&x->wait.lock);
- if (!x->done) {
- DECLARE_WAITQUEUE(wait, current);
-
- wait.flags |= WQ_FLAG_EXCLUSIVE;
- __add_wait_queue_tail(&x->wait, &wait);
- do {
- __set_current_state(TASK_UNINTERRUPTIBLE);
- spin_unlock_irq(&x->wait.lock);
- timeout = schedule_timeout(timeout);
- 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:
- spin_unlock_irq(&x->wait.lock);
- return timeout;
-}
-EXPORT_SYMBOL(wait_for_completion_timeout);
-
int fastcall __sched wait_for_completion_interruptible(struct completion *x)
{
int ret = 0;
@@ -3209,42 +3179,6 @@
}
EXPORT_SYMBOL(wait_for_completion_interruptible);
-unsigned long fastcall __sched
-wait_for_completion_interruptible_timeout(struct completion *x,
- unsigned long timeout)
-{
- might_sleep();
-
- spin_lock_irq(&x->wait.lock);
- if (!x->done) {
- DECLARE_WAITQUEUE(wait, current);
-
- wait.flags |= WQ_FLAG_EXCLUSIVE;
- __add_wait_queue_tail(&x->wait, &wait);
- do {
- if (signal_pending(current)) {
- timeout = -ERESTARTSYS;
- __remove_wait_queue(&x->wait, &wait);
- goto out;
- }
- __set_current_state(TASK_INTERRUPTIBLE);
- spin_unlock_irq(&x->wait.lock);
- timeout = schedule_timeout(timeout);
- 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:
- spin_unlock_irq(&x->wait.lock);
- return timeout;
-}
-EXPORT_SYMBOL(wait_for_completion_interruptible_timeout);
-
#define SLEEP_ON_VAR \
unsigned long flags; \
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC: 2.6 patch] kernel/sched.c: remove two unused functions
2005-05-13 0:47 Adrian Bunk
@ 2005-05-13 6:48 ` Ingo Molnar
2005-05-14 5:35 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2005-05-13 6:48 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Andrew Morton, linux-kernel
* Adrian Bunk <bunk@stusta.de> wrote:
> This patch removes the unused functions wait_for_completion_timeout
> and wait_for_completion_interruptible_timeout.
>
> Is any usage for them planned or is this patch OK?
yes, there's usage planned and patches pending - to convert certain sort
of semaphore-based completion code to real completion code.
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC: 2.6 patch] kernel/sched.c: remove two unused functions
2005-05-13 0:47 Adrian Bunk
2005-05-13 6:48 ` Ingo Molnar
@ 2005-05-14 5:35 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2005-05-14 5:35 UTC (permalink / raw)
To: Adrian Bunk; +Cc: linux-kernel
Adrian Bunk <bunk@stusta.de> wrote:
>
> This patch removes the unused functions wait_for_completion_timeout and
> wait_for_completion_interruptible_timeout.
>
> Is any usage for them planned or is this patch OK?
>
>From the changelog for the patch which added these functions:
Adds 3 new completion API calls, which are a straightforward extension of
the current APIs:
int wait_for_completion_interruptible(struct completion *x);
unsigned long wait_for_completion_timeout(struct completion *x,
unsigned long timeout);
unsigned long wait_for_completion_interruptible_timeout(
struct completion *x, unsigned long timeout);
This enables the conversion of more semaphore-using code to completions.
There is code that cannot be converted right now (and is forced to use
semaphores) because these primitives are missing. Thomas Gleixner has a
bunch of patches to make use of them.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-14 5:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-06 22:20 [RFC: 2.6 patch] kernel/sched.c: remove two unused functions Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2005-05-13 0:47 Adrian Bunk
2005-05-13 6:48 ` Ingo Molnar
2005-05-14 5:35 ` Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.