Re: Do per cpu variables need to be atomic?

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

 



On Thu, 10 Jul 2014, Pranith Kumar wrote:

> > Correct.
>
> I understand one of the advantage of using these per cpu variables is
> avoiding disabling interrupts. But what happens when this cpu is
> preempted? The new processor will be working on the other cpu
> variables, but without barriers will it see the latest values?

The this_cpu ops are atomic vs preemption. So you will always get the
value of the current processor. If preemption occurs then then instruction
will get the per cpu data from the new processor.

I cannot post to kernelnewbies@xxxxxxxxxxxxxxxxx. Some moderator approval
is required. Can you fix that?


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[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