LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   sleeping function called from invalid context (https://www.linuxquestions.org/questions/programming-9/sleeping-function-called-from-invalid-context-393413/)

kushneeraj 12-15-2005 11:25 PM

sleeping function called from invalid context
 
HI All,

I wrote one module and inserted in 2.6.9 version kernel.
In my module there is a call for local_irq_save(flags).

In kernel log messages i see this debug message for my call to local_irq_save(flags).


Debug: sleeping function called from invalid context at mm/slab.c:2052
in_atomic():0, irqs_disabled():1

What this error is and how to resolve it?

Thanks
Neeraj

mehuljv 12-17-2005 05:28 AM

hi,
are you using kmem_cache_alloc() routine inside your module ?? looks like you are allocating some memory in the interrupt context using GFP_WAIT flag enabled.
do post some of the code of your module if you can.

Regards
Mehul.

nirvruti 04-16-2013 02:23 AM

Sleeping function bug in fedora 11
 
Hello,

I am trying to read file from kernel module.i have used filp_open() function.But when i run this module my dmesg shows bug "sleeping function called from invalid context at mm/slab.c:1719 in_atomic():0, irqs_disabled():1.
Because of this i am unable to open the file. I am unable to resolve this bug.
Plz help me.

NevemTeve 04-16-2013 05:32 AM

Meta: Are you guys sure that you are ready for writing kernel-code? Methinks you should collect a few hundreds reputation points beforehand.

konsolebox 04-16-2013 07:08 AM

@nirvruti I suggest you go checkout http://kernelnewbies.org/. You could try visiting their forum, their IRC channel, or joining the mailing list. And if you're brave enough and informative enough you could try asking question from the main linux kernel mailing list, though I don't really recommend it. But just to inform you. You could also just join the list without posting if you're curious.

Habitual 04-16-2013 10:28 AM

Quote:

Originally Posted by konsolebox (Post 4932360)
@nirvruti I suggest ...

Not re-opening 8 year old threads?

mina86 04-16-2013 01:39 PM

Read http://lwn.net/Kernel/LDD3/ and only then come back with any questions.

Also, to answer your question, you are trying to open the file from a context where sleeping is not allowed. My guess is that you're doing so from an interrupt handler.

konsolebox 04-16-2013 07:22 PM

Quote:

Originally Posted by Habitual (Post 4932513)
Not re-opening 8 year old threads?

Yeah I did noticed it but I didn't mind. One curious folk's quest for hacking the kernel is pretty admirable.

mina86 04-16-2013 08:25 PM

Quote:

Originally Posted by Habitual (Post 4932513)
Not re-opening 8 year old threads?

The original question was not resolved and the new poster has the same issue as OP. What's wrong with reopening a thread?


All times are GMT -5. The time now is 12:52 AM.