Re: preempt_disable() as synchronization tool

vinit dhatrak <[email protected]>
Newsgroups gmane.linux.newbie,gmane.linux.kernel.kernelnewbies
Message-ID <[email protected]>
On Sat, Oct 10, 2009 at 10:16 AM, askb <[email protected]> wrote:
>
>> >
>> > Lastly, is it allowable to schedule / sleep immediately after a call
>> > to preempt_disable()?
>>
>> No I guess kernel will panic with some error like , "scheduling while
>> in Atomic Context".
>
> Sorry, I somehow missed out reading this. Can you let me know why its
> not possible to schedule within preempt_disable() and preempt_enable()?
> >From the code the schedule functions starts by disabling preemption?
> Thanks in advance. - Anil
>
>

Because, preempt_disable increments the preempt count and before
scheduling the next task, schedule() function checks for the preempt
count for the previous task. If its greater than 0 then it will throw
an error "BUG: scheduling while atomic:"

-Vinit
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.