Re: preempt_disable() as synchronization tool

vinit dhatrak <[email protected]>
Newsgroups gmane.linux.kernel.kernelnewbies,gmane.linux.newbie
Message-ID <[email protected]>
On Fri, Oct 9, 2009 at 9:13 AM, Daniel Rodrick <[email protected]> wrote:
> Hi List,
>
> I have few queries related to preempt_disable() and would appreciate
> any answers to it.
>
> Firstly, Does preempt_disable() disable the preemption on all the
> processors or on just the local processor?

I guess just local processor as the preempt count is maintained in
current thread_info struct. Correct me if I am wrong here.

>
> Secondly, a preempt_disable() a sufficient synchronization technique
> to guard a data that is shared only among process context code on a
> Uni-processor? And on SMP?

It is sufficient only in case of uni-processor (Actually spin_lock
also just disables preemption in case of uni-processor)

>
> 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".

>
> Thanks & Best Regards,
>
> Dan
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to [email protected]
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ
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.