summaryrefslogtreecommitdiff
path: root/include/linux/overflow.h
diff options
context:
space:
mode:
authorDave Martin <Dave.Martin@arm.com>2020-06-10 20:03:10 +0300
committerWill Deacon <will@kernel.org>2020-06-15 18:57:42 +0300
commit1e570f512cbdc5e9e401ba640d9827985c1bea1e (patch)
treee099a494e37b2b046c57be93dd524590df456ff2 /include/linux/overflow.h
parent9ba6a9efa4a4c721d0115089bf422f82b8a59e45 (diff)
downloadlinux-1e570f512cbdc5e9e401ba640d9827985c1bea1e.tar.xz
arm64/sve: Eliminate data races on sve_default_vl
sve_default_vl can be modified via the /proc/sys/abi/sve_default_vl sysctl concurrently with use, and modified concurrently by multiple threads. Adding a lock for this seems overkill, and I don't want to think any more than necessary, so just define wrappers using READ_ONCE()/ WRITE_ONCE(). This will avoid the possibility of torn accesses and repeated loads and stores. There's no evidence yet that this is going wrong in practice: this is just hygiene. For generic sysctl users, it would be better to build this kind of thing into the sysctl common code somehow. Reported-by: Will Deacon <will@kernel.org> Signed-off-by: Dave Martin <Dave.Martin@arm.com> Link: https://lore.kernel.org/r/1591808590-20210-3-git-send-email-Dave.Martin@arm.com [will: move set_sve_default_vl() inside #ifdef to squash allnoconfig warning] Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'include/linux/overflow.h')
0 files changed, 0 insertions, 0 deletions