lkml.org 
[lkml]   [1999]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectwhy would sleep not sleep...????
NOTE: suggestions as to how to approach debugging this would
be (almost) as valuable as an explanation! I'm at my wits end.

I am seeing a sleep call return for unknown reasons....!

As I understand it, a call to interruptible_sleep_on(&wq) should
sleep until either a call to wake_up_interruptible(&wg) *OR* an
unmasked signal is delivered.

This is with Linux 2.0.35, doesn't seem to happen with 2.2, but
that is *not* comforting.

All my calls to sleep_on()/wake_up() are made through these
functions, the task structure has information about the
open connections to my module, and the kprint(debug..)s are
conditionally compiled in for debugging. Since I can
see every wake or sleep in the debug log, I'm convince I'm not
"accidently" waking my blocked processes up, and there are
never any pending signals, blocked or unblocked. Still, I'm
waking up.

Q1) can wake_up() cause scheduling? It would appear not, from
the sources.

Q2) Are there any other known causes of waking up?

/*
* Task wake and sleep wrappers.
*/

void SrrTaskWake(SrrTask* task, int state)
{
// kprintf(debug ....)

task->state = state;
task->waker = current->pid;

wake_up_interruptible(&task->wq);
}

void SrrTaskSleep(SrrTask* task, int state)
{
// kprintf(debug ....)

task->state = state;
task->waker = 0;

if(task->pid != current->pid) {
Oops("current %d trying to sleep on task %d!\n", current->pid, task->pid);
return;
}

interruptible_sleep_on(&task->wq);

if(!task->waker && !signal_pending(current)) {
// --------- PROBLEM ------------
// WHAT THE **** HAPPENED HERE??!!!
//printk(bad bad bad
return;
}
// kprintf(debug ....)
}




--
Sam Roberts (sam@cogent.ca), Cogent Real-Time Systems (www.cogent.ca)
"News is very popular among its readers." - RFC 977 (NNTP)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.029 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site