Re: [PATCH v2 1/1] doc: Add remote CPU access details and others to this_cpu_ops.txt

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

 



Regarding atomic_t in per cpu areas: I am uncomfortable especially
because both locked and unlocked RMW write operations could be acting on
values in the same cacheline. I am concerned that the unlocked operation
could have an unpredictable result.


f.e. the following per cpu data structure

struct test {
	atomic_t a;
	int b;
} onecacheline;


Local cpu does

	this_cpu_inc(onecacheline.b);

If this is racing with a remote cpus:

	atomic_inc(percpu(&a, cpu))

then we have on x86 a increment operation with locked semantics racing
with an unlocked one on the same cacheline.

--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux