[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I make a kernel module "sleep" without affecting other kernel modules?
On Wed, 1 Dec 2004 09:36:50 -0500, Prokopenko, Konstantyn
<kproko@xxxxxxxxxxxx> wrote:
> Yes, you can use schedule_timeout() if you don't need to wait on a condition
> to change before timeout expires.
> Now, I've got news....
> Schedule_timeout() internally calls kernel timer functions (init, add,
> del_sync). Value "expire" for timer is calculated as
> jiffies+requested_ticks. No check is done for wraps unless it is done within
> timer functions that I really doubt. So either way we are not
> protected :)...
>
> Konstantyn
>
Guys, *all* of you at kernelnewbies have my heartfelt thanks :-) I've
learned more by reading kernelnewbies email in the last week than I
have by poring through books. Many, many, many Thanks :-).
Konstantyn, I just looked at the source code for schedule_timeout()
for the 2.6.8.1 Kernel at
http://lxr.linux.no/source/kernel/timer.c?v=2.6.8.1#L1103, and you're
right, there isn't a check for (jiffies + timeout) being wrapped
around.
Thanks again!
Karthik.
--
There are things known and things unknown, in between lie the Doors
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/