Re: preempt_disable() as a synchronization tool

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

 



Hi .....

On Fri, Oct 9, 2009 at 12:08 PM, Daniel Rodrick
<daniel.rodrick@xxxxxxxxx> 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 ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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