summaryrefslogtreecommitdiffstats
path: root/lib/dhry_1.c
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2022-12-16 16:04:40 +0100
committerAndrew Morton <akpm@linux-foundation.org>2023-02-02 22:50:01 -0800
commit88ad32a799ddc92eafd2ae204cb43f04ac20a05c (patch)
treea4797d1b353073c535eba0f4c05e1cb758ed7337 /lib/dhry_1.c
parent805afd8300998948d16bdba0358dcfeb202a70d5 (diff)
downloadlinux-88ad32a799ddc92eafd2ae204cb43f04ac20a05c.tar.gz
linux-88ad32a799ddc92eafd2ae204cb43f04ac20a05c.tar.bz2
linux-88ad32a799ddc92eafd2ae204cb43f04ac20a05c.zip
include/linux/percpu_counter.h: race in uniprocessor percpu_counter_add()
The percpu interface is supposed to be preempt and irq safe. But: The uniprocessor implementation of percpu_counter_add() is not irq safe: if an interrupt happens during the +=, then the result is undefined. Therefore: switch from preempt_disable() to local_irq_save(). This prevents interrupts from interrupting the +=, and as a side effect prevents preemption. Link: https://lkml.kernel.org/r/20221216150441.200533-2-manfred@colorfullife.com Signed-off-by: Manfred Spraul <manfred@colorfullife.com> Cc: "Sun, Jiebin" <jiebin.sun@intel.com> Cc: <1vier1@web.de> Cc: Alexander Sverdlin <alexander.sverdlin@siemens.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'lib/dhry_1.c')
0 files changed, 0 insertions, 0 deletions