lkml.org 
[lkml]   [2001]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectschedule() seems to have changed.

It seems that the nature of schedule() has changed in recent
kernels. I am trying to update my drivers to correspond to
the latest changes. Here is an example:


This waits for some hardware (interrupt sets flag), time-out in one
second. This is in an ioctl(), i.e., user context:

set_current_state(TASK_INTERRUPTIBLE);
current->policy = SCHED_YIELD;
timer = jiffies + HZ;
while(time_before(jiffies, timer))
{
if(flag) break;
schedule();
}
set_current_state(TASK_RUNNING);

The problem is that schedule() never returns!!! If I use
schedule_timeout(1), it returns, but the granularity
of the timeout interval is such that it slows down the
driver (0.1 ms).

So, is there something that I'm not doing that is preventing
schedule() from returning? It returns on a user-interrupt (^C),
but otherwise gives control to the kernel forever.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.


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

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