Thread (2 messages) 2 messages, 2 authors, 2012-11-02

kernel hangs within kernel_fpu_begin()...kernel_fpu_end()

From: Tobias Boege <hidden>
Date: 2012-11-02 09:18:45

On Thu, 01 Nov 2012, Digant wrote:
Hello ,
I am developing a feature in a X86-64 machine running kernel 3.5.5. I am
exporting this symbol to test FPU and kernel compiles fine if I call this
symbol from my module it works great. But when I used this symbol from
scheduler particularly *enqueue_fair()* (few times per second)
in/kernel/sched/fair.c it behaves weirdly. During boot kernel hangs
abruptly after few hundreds correct prints in this function after 1st
print.
Have a look at the comment above arch/x86/kernel/i387.c:irq_fpu_usable()
which states that it is sometimes awry to use the FPU from interrupt
context. Seems not unlikely to me that you run into one of these situations
regularly from within the timer interrupt. Maybe you should just print the
return value of that function, too, to see if you are messing up anything.
Am I missing any rule, because I looked it up on internet they says nothing
else than this way to use fpu. Any help is appreciated. I tried 10-20 boots
and each time it hangs.

*Code snippet for reference:*
  1 /*test FPU*/
  2 #include <asm/i387.h>
  3 #include <linux/time.h>
  4
  5
  6 void my_symbol(void){
  7     unsigned long i = get_seconds();
  8
  9     printk(KERN_DEBUG "i:%lu,",i);
 10     kernel_fpu_begin();
 11             float d = 3.123456*(i%3);
 12             i=(unsigned long)(d*1000000);
 13     kernel_fpu_end();
 14     printk(KERN_DEBUG "%lu\n",i);
 15 }
 16 EXPORT_SYMBOL_GPL(my_symbol);
Regards,
Tobi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help