Re: preempt_disable() - disables preemption on all processors?

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

 



Hi...

And the get_cpu() ? Its not supposed to disable preemption in all cpus?
from include/linux/smp.h:

#define get_cpu()               ({ preempt_disable(); smp_processor_id(); })
Same thing, only for current CPU with executes the code path that calls preempt_enable/disable(). You can check the definition of preempt_count() in {kerneldir}/include/linux/smp.h:

#define preempt_count() (current_thread_info()->preempt_count)


There, you'll see that the preemption flag is actually tied to current task_struct's stack. Since a task run on a processor at a time, I follow the same logic that preemption is also enabled/disabled for current processor only.

regards,

Mulyadi.


--
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