Re: kernel stuck test

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

 



Hi,

On Wed, Oct 6, 2010 at 10:14 PM, Mulyadi Santosa
<mulyadi.santosa@xxxxxxxxx> wrote:
> Hi :)
>
>
>
> On Thu, Oct 7, 2010 at 04:52, Sengottuvelan S <sengottuvelan.s@xxxxxxxxx> 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 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