summaryrefslogtreecommitdiff
path: root/include/kunit
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2023-09-04 18:08:49 +0300
committerAndrew Morton <akpm@linux-foundation.org>2023-10-04 20:32:20 +0300
commit77cd814835df22e177a9caac1b046f7ffdfeedd0 (patch)
tree0c93012406c3a1f6c74a4de1822524dcfa90f527 /include/kunit
parent91e79d22be75fec88ae58d274a7c9e49d6215099 (diff)
downloadlinux-77cd814835df22e177a9caac1b046f7ffdfeedd0.tar.xz
mm/vmstat: use this_cpu_try_cmpxchg in mod_{zone,node}_state
Use this_cpu_try_cmpxchg instead of this_cpu_cmpxchg (*ptr, old, new) == old in mod_zone_state and mod_node_state. x86 CMPXCHG instruction returns success in ZF flag, so this change saves a compare after cmpxchg (and related move instruction in front of cmpxchg). Also, try_cmpxchg implicitly assigns old *ptr value to "old" when cmpxchg fails. There is no need to re-read the value in the loop. No functional change intended. Link: https://lkml.kernel.org/r/20230904150917.8318-1-ubizjak@gmail.com Signed-off-by: Uros Bizjak <ubizjak@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/kunit')
0 files changed, 0 insertions, 0 deletions