Trying to make kernel thread sleep

From: Dinesh Ahuja
Date: Mon Aug 21 2006 - 00:29:54 EST

Hi All,

I am trying to put kernel thread to sleep via
interruptible_sleep_on_timeout(). Body of kernel
thread function is as follows

static int print_taskinfo(void * data)
wait_queue_head_t wait;

init_waitqueue_head (&wait);
for (;;)
// do something useful here.
interruptible_sleep_on_timeout(&wait, HZ);
//check whether we have to break loop or

I am facing following kernel oops :

Unable to handle kernel NULL pointer dereference at
virtual address 00000005
printing eip:
*pde = 00000000
Oops: 0002
CPU: 0
EIP: 0060:[<c011905d>] Tainted: PF
EFLAGS: 00010086

EIP is at interruptible_sleep_on_timeout [kernel] 0x2d
eax: c2cadfc4 ebx: 00000286 ecx: c2cadfac edx:
esi: 00000064 edi: c8dc7540 ebp: c2cadfbc esp:
ds: 0068 es: 0068 ss: 0068
Process insmod (pid: 3884, stackpage=c2cad000)
Stack: 00000000 c2cac000 00000f2b 00000000 c034c000
c8dc74c0 c2cadfec d087d1a1
00000001 c2cadfc8 c2cadfc8 00000000 00000000
00000000 00000000 d087d074
00000000 00000000 00000000 c010742d 00000000
00000000 00000000
Call Trace: [<d087d1a1>] print_taskinfo [hello1]
0x12d (0xc2cadfc0))
[<d087d074>] print_taskinfo [hello1] 0x0 (0xc2cadfe0))
[<c010742d>] kernel_thread_helper [kernel] 0x5

Can anyone guide me where I am going wrong?


Yahoo! India Answers: Share what you know. Learn something new
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at