--- 2.6/net/sunrpc/sched.c 2004-01-17 12:19:50.000000000 +0100
+++ build-2.6/net/sunrpc/sched.c 2004-01-17 12:52:33.000000000 +0100
@@ -1060,7 +1060,7 @@
void
rpciod_down(void)
{
- unsigned long flags;
+ DECLARE_WAITQUEUE(wait, current);
down(&rpciod_sema);
dprintk("rpciod_down pid %d sema %d\n", rpciod_pid, rpciod_users);
@@ -1085,17 +1085,22 @@
/*
* Display a message if we're going to wait longer.
*/
- while (rpciod_pid) {
+ add_wait_queue(&rpciod_killer, &wait);
+ for (;;) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (rpciod_pid == 0)
+ break;
dprintk("rpciod_down: waiting for pid %d to exit\n", rpciod_pid);
if (signalled()) {
dprintk("rpciod_down: caught signal\n");
break;
}
- interruptible_sleep_on(&rpciod_killer);
+ schedule();
}
- spin_lock_irqsave(¤t->sighand->siglock, flags);
+ remove_wait_queue(&rpciod_killer, &wait);
+ spin_lock_irq(¤t->sighand->siglock);
recalc_sigpending();
- spin_unlock_irqrestore(¤t->sighand->siglock, flags);
+ spin_unlock_irq(¤t->sighand->siglock);
out:
up(&rpciod_sema);
}
Manfred Spraul <[email protected]> writes:
> - while (rpciod_pid) {
> + add_wait_queue(&rpciod_killer, &wait);
> + for (;;) {
> + set_current_state(TASK_INTERRUPTIBLE);
> + if (rpciod_pid == 0)
> + break;
> dprintk("rpciod_down: waiting for pid %d to exit\n", rpciod_pid);
> if (signalled()) {
> dprintk("rpciod_down: caught signal\n");
> break;
> }
> - interruptible_sleep_on(&rpciod_killer);
> + schedule();
> }
> - spin_lock_irqsave(¤t->sighand->siglock, flags);
> + remove_wait_queue(&rpciod_killer, &wait);
> + spin_lock_irq(¤t->sighand->siglock);
> recalc_sigpending();
> - spin_unlock_irqrestore(¤t->sighand->siglock, flags);
> + spin_unlock_irq(¤t->sighand->siglock);
> out:
> up(&rpciod_sema);
> }
Aren't you forgetting to set_current_state(TASK_RUNNING) after the
loop?
--
Peter Osterlund - [email protected]
http://w1.894.telia.com/~u89404340