LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-15-2005, 11:25 PM   #1
kushneeraj
LQ Newbie
 
Registered: Oct 2005
Posts: 6

Rep: Reputation: 0
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
 
Old 12-17-2005, 05:28 AM   #2
mehuljv
Member
 
Registered: Nov 2004
Posts: 72

Rep: Reputation: 15
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.
 
Old 04-16-2013, 02:23 AM   #3
nirvruti
LQ Newbie
 
Registered: Sep 2012
Posts: 14

Rep: Reputation: Disabled
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.
 
Old 04-16-2013, 05:32 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 1,571

Rep: Reputation: 471Reputation: 471Reputation: 471Reputation: 471Reputation: 471
Meta: Are you guys sure that you are ready for writing kernel-code? Methinks you should collect a few hundreds reputation points beforehand.
 
Old 04-16-2013, 07:08 AM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,243
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
@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.
 
Old 04-16-2013, 10:28 AM   #6
Habitual
Senior Member
 
Registered: Jan 2011
Distribution: Slack14_64_Multilib
Posts: 3,042
Blog Entries: 4

Rep: Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734Reputation: 734
Quote:
Originally Posted by konsolebox View Post
@nirvruti I suggest ...
Not re-opening 8 year old threads?
 
Old 04-16-2013, 01:39 PM   #7
mina86
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 347

Rep: Reputation: 145Reputation: 145
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.
 
Old 04-16-2013, 07:22 PM   #8
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,243
Blog Entries: 15

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by Habitual View Post
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.
 
Old 04-16-2013, 08:25 PM   #9
mina86
Member
 
Registered: Aug 2008
Distribution: Slackware
Posts: 347

Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by Habitual View Post
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
howto know whether a function is called in signal handler snowing Programming 1 11-07-2005 09:55 PM
USB Driver Probe function not being called xtom Fedora 0 10-28-2005 03:48 PM
invalid context in SELinux lothario Linux - Security 1 06-17-2005 04:03 PM
how function with argumets called without argumets? cranium2004 Programming 1 03-15-2005 08:32 AM
** WLAN busy-sleeping in interrupt context! adelaideyip Linux - Wireless Networking 0 08-20-2004 03:55 PM


All times are GMT -5. The time now is 07:13 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration