Schedule while atomic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have registered a callback function in a kernel module with the Netfilter 
hook NF_IP_LOCAL_IN. In the function the following statements lead to a 
kernel freeze:

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(HZ);

Another try (with the same result) for letting the hook function sleep for a 
certain amount of time:

while (time_before(jiffies,jiffies+HZ));

The error message for the kernel oops is "scheduling while atomic" for both 
attempts.

Why is this error ocurring? Are the Netfilter hooks atomic?
How can a sleep in a hook function be achieved?

Regards,
Andreas Gaupmann


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux