diff options
author | 2023-09-04 17:08:49 +0200 | |
---|---|---|
committer | 2023-10-04 10:32:20 -0700 | |
commit | 77cd814835df22e177a9caac1b046f7ffdfeedd0 (patch) | |
tree | 0c93012406c3a1f6c74a4de1822524dcfa90f527 /mm/mremap.c | |
parent | mm: convert DAX lock/unlock page to lock/unlock folio (diff) | |
download | wireguard-linux-77cd814835df22e177a9caac1b046f7ffdfeedd0.tar.xz wireguard-linux-77cd814835df22e177a9caac1b046f7ffdfeedd0.zip |
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 'mm/mremap.c')
0 files changed, 0 insertions, 0 deletions