Hi,

On Wed, Oct 6, 2010 at 10:14 PM, Mulyadi Santosa
<[email protected]> wrote:
> Hi :)
>
>
>
> On Thu, Oct 7, 2010 at 04:52, Sengottuvelan S <[email protected]> 
> wrote:
>> Hi Santosa,
>
> You forgot to cc: kernelnewbies :)
>
>> Can you let me point me how to disable premption and interrupts in kernel
>> mode.
>
> I think spin_lock_irqsave() followed by tight loop will do the
> job...tight loop, ok? not schedule_timeout.... I forgot the function's
> name to disable preemption, IIRC spin_lock_irqsave implies disabling
> preemption, but that's just my guess.

You can should only need to use local_irq_disable. Using a spinlock
only helps if you have another thread executing the same code. If only
one thread executes a given piece of code then the spinlock doesn't
actually do anything.

Disabling interrupts disables preemption on the current core.

You can call preempt_disable to disable preemption on all cores.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.DaveHylands.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