From: tobias@gambas-buch.de (Tobias Boege)
To: kernelnewbies@lists.kernelnewbies.org
Subject: kernel hangs within kernel_fpu_begin()...kernel_fpu_end()
Date: Fri, 2 Nov 2012 10:18:45 +0100 [thread overview]
Message-ID: <20121102091845.GC544@aurora> (raw)
In-Reply-To: <CAHbVqFYK=8_-KXcbYeD77sbuz2Tu7hrHMcdFFzfMuf43+msueQ@mail.gmail.com>
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
prev parent reply other threads:[~2012-11-02 9:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 2:10 kernel hangs within kernel_fpu_begin()...kernel_fpu_end() Digant
2012-11-02 9:18 ` Tobias Boege [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121102091845.GC544@aurora \
--to=tobias@gambas-buch.de \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).