Re: sleeping in kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 08, 2005 at 17:16:23 +0000, Talib Alim wrote:
> I am running my code under debugging kernel (spin lock debugging). I am 
> getting following message.
> 
> Oct  7 18:36:46 localhost kernel: Debug: sleeping function called from 
> invalid context at mm/slab.c:2082
> 
> My question what is considered sleeping in kernel, beside
> 
> - memory allocation not using GFP_ATOMIC flag
> - explicitly calling schedule (or its derivatives)
- calling schedule via wait_event or sleep_on
- taking semaphores (down() and variants)
- waiting for completion
- anything that does the above, of course

As for "considered sleeping" -- sleeping _means_ calling schedule(). That's
it. There are many common functions that do call schedule(). The above are
the most low level ones.

Generally speaking you should only call in interrupts or under spinlocks the
functions, that are /designed/ to be called in such context.

--
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux