Dear All:

  I encounter a weird situation when I am building a module.
  I use kmalloc(.., GFP_KERNEL) to require memory resource.
  However, if I try to use 'insmod' to load my module.
  'insmod' just segmentation fault and get following in 'dmesg'

 invalid operand: 0000
 CPU:    0
 EIP:    0010:[<c012451b>]    Not tainted
 EFLAGS: 00010206
 Process insmod (pid: 971, stackpage=c1f07000)
 Stack: c10f3118 c10f3110 00000202 00000007 c01
        c10f3110 00000007 c4cdfb80 00000014 c4c
        00000007 c4cdfb80 0000000f c4cdfa9c c1f
 Call Trace: [<c01110b4>] [<c012486f>] [<c4cdfb
             [<c4cdfb80>] [<c4cdfa9c>] [<c4ccf8fc>] [<c4
 ..........

 The value of EIP looks like locating in 'kmem_cache_grow()'.
 Then I try to change the kmalloc flag from 'GFP_KERNEL' to 'GFP_ATOMIC'.
 Suddenlly, it works!!....I suspect this a process problem??
 So I try to print out the 'pid' value in my module.
 Found that the pid of 'insmod' is different with the one executing 'kmalloc'.

 Is this possible? The process of 'insmod' is suspended, then another process
 continues the left work, and then wake up 'insmod' process to finish.

 If this is possible, does it mean that we have to use 'GFP_ATOMIC' not 
 'GFP_KERNEL' for kmalloc() in module??

 I am confused!! Did I do something wrong??

 Execuse me, this may be off-topic since I try it on x86 not arm. 

 Regards

kirk

----== Mailed via Openfind ==-----
http://mail2000.com.tw/ ���ѱM�~�q�l�l��A��

_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.

Reply via email to