Skip to contentSkip to conversation

Schedule while atomic

DISCUSSION Andreas Gaupmann 1 participant 1 message May 6, 2006

lore
Share & tools
lore
#0 lore raw

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