Hi .....

On Fri, Oct 9, 2009 at 12:08 PM, Daniel Rodrick
<[email protected]> wrote:
> Firstly, Does preempt_disable() disable the preemption on all the
> processors or on just the local processor?

Just the local processor AFAIK.

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

Well, if you're sure this data structure is shared *only*  between
process (including kernel thread), then I am quite sure
preempt_disable is enough in Uni Processor. However, in SMP situation,
as you can predict by yourself, it's not

> Lastly, is it allowable to schedule / sleep immediately after a call
> to preempt_disable()?

You shall hit "scheduling while atomic" bug. Check schedule()
function, there you'll see it's calling schedule_debug. Eventually, it
will check whether the current preempt variable is >=0 or not. If it
is, stack is dumped.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to