Re: I attached a test module to reproduce this bug. Does I miss something in my code or is there a bug?

Previous thread: vmalloc performance by Steven Whitehouse on Monday, April 12, 2010 - 9:27 am. (30 messages)

Next thread: [PATCH] JFS: Free sbi memory in error path by Jan Blunck on Monday, April 12, 2010 - 9:40 am. (3 messages)
From: Stefan Agner
Date: Monday, April 12, 2010 - 9:23 am

Unable to handle kernel paging request at kthread_should_stop

Hello,

In a kernel module which used to work on previous kernel versions I tried to
start a kernel thread (kthread). In the threads mainloop I poll the method
kthread_should_stop which seems to fail.

[   65.531778] BUG: unable to handle kernel paging request at fffffffc
[   65.532011] IP: [<c103bf7c>] kthread_should_stop+0x10/0x14
[   65.532011] *pde = 01551067 *pte = 00000000
[   65.532011] Oops: 0000 [#1] SMP
[   65.532011] last sysfs file: /sys/devices/virtual/dmi/id/board_asset_tag
[   65.532011] Modules linked in: testmod [last unloaded: scsi_wait_scan]
[   65.532011]
[   65.532011] Pid: 3392, comm: test-module Not tainted 2.6.33.2-rt13 #1 E243/
E243
[   65.532011] EIP: 0060:[<c103bf7c>] EFLAGS: 00010206 CPU: 0
[   65.532011] EIP is at kthread_should_stop+0x10/0x14
[   65.532011] EAX: 00000000 EBX: dd9e8430 ECX: 00006161 EDX: 00000286
[   65.532011] ESI: 00000000 EDI: e00d8000 EBP: dc8e1fbc ESP: dc8e1fb0
[   65.532011]  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068 preempt:00000000
[   65.532011] Process test-module (pid: 3392, ti=dc8e0000 task=dd9e8430
task.ti=dc8e0000)
[   65.535828] Stack:
[   65.535828]  e00d808c 00000000 d3945f50 dc8e1fe4 c103bfe1 00000000 00000001
00000101
[   65.535828] <0> dc8e1fd0 dc8e1fd0 00000000 c103bf80 d3945f44 00000000
c1002e36 00000000
[   65.535828] <0> 00000000 00000000 00000000 00000000
[   65.535828] Call Trace:
[   65.535828]  [<e00d808c>] ? runloop+0x8c/0xa4 [testmod]
[   65.535828]  [<c103bfe1>] ? kthread+0x61/0x66
[   65.535828]  [<c103bf80>] ? kthread+0x0/0x66
[   65.535828]  [<c1002e36>] ? kernel_thread_helper+0x6/0x10
[   65.535828] Code: 8b 47 18 01 46 10 8b 55 f0 8d 47 08 e8 b1 a9 32  
00 8d 65 f4
5b 5e 5f 5d c3 90 90 55 64 a1 7c 34 54 c1 8b 80 8c 01 00 00 89 e5 5d  
<8b> 40 fc
c3 55 ba a4 f6 59 c1 89 e5 57 56 53 89 c3 83 ec 14 8b
[   65.535828] EIP: [<c103bf7c>] kthread_should_stop+0x10/0x14 SS:ESP
0068:dc8e1fb0
[   65.535828] CR2: 00000000fffffffc
[   ...
From: Thomas Gleixner
Date: Monday, April 12, 2010 - 1:32 pm

Stefan,

please use short and descriptive subject lines. "I attached a test
module to reproduce this bug ..." does not tell anything.




 Do not call daemonize() for a kthread created with kthread_create().


  That EINTR can never happen. You set the task to

 The init code is called once, so no need to check for thread == NULL
 before calling kthread_create().



 Simply use kthread_run(....), which implies kthread_create() and
 wake_up_process().

Thanks,

	tglx
--

From: Stefan Agner
Date: Monday, April 12, 2010 - 11:56 pm

Hi Thomas,

In fact this was my intended Subject line... The current subject line was a
copy and paste accident! Due to the fact that my online mailer eats mails
Removing this already solved the bug message.

I fixed all other bugs as well and attached the updated file.

Thanks a lot

-- 
Stefan Agner



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
Previous thread: vmalloc performance by Steven Whitehouse on Monday, April 12, 2010 - 9:27 am. (30 messages)

Next thread: [PATCH] JFS: Free sbi memory in error path by Jan Blunck on Monday, April 12, 2010 - 9:40 am. (3 messages)