2008-03-19 20:49:55

by Rick Brown

[permalink] [raw]
Subject: preempt_disable() question

Hi,

I've asked this on kernel newbies before, but not enough responses.

Does preempt_disable() disable preemption on all the processors, or
just the local processor?

TIA,

Rick


2008-03-19 23:54:20

by Jiri Slaby

[permalink] [raw]
Subject: Re: preempt_disable() question

On 03/19/2008 03:14 AM, Rick Brown wrote:
> Hi,
>
> I've asked this on kernel newbies before, but not enough responses.
>
> Does preempt_disable() disable preemption on all the processors, or
> just the local processor?

AFAIU preempt_disable increments preempt count of the current task, so that
nobody will take the cpu which it is executing on (scheduler doesn't allow that)
while the task is running until preempt count lowers to 0. How do you mean the
"disabling preemption on local processor", how/why would you want to disable
preemption of task potentially running on the other one?

2008-03-20 00:00:47

by Peter Zijlstra

[permalink] [raw]
Subject: Re: preempt_disable() question

On Wed, 2008-03-19 at 07:44 +0530, Rick Brown wrote:
> Hi,
>
> I've asked this on kernel newbies before, but not enough responses.
>
> Does preempt_disable() disable preemption on all the processors, or
> just the local processor?

Just the local one

2008-03-20 16:23:33

by Daniel Walker

[permalink] [raw]
Subject: Re: preempt_disable() question


On Wed, 2008-03-19 at 07:44 +0530, Rick Brown wrote:
> Hi,
>
> I've asked this on kernel newbies before, but not enough responses.
>
> Does preempt_disable() disable preemption on all the processors, or
> just the local processor?

Just the local processor.

Daniel