diff options
| author | Uros Bizjak <ubizjak@gmail.com> | 2023-09-04 17:08:49 +0200 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2023-10-04 10:32:20 -0700 |
| commit | 77cd814835df22e177a9caac1b046f7ffdfeedd0 (patch) | |
| tree | 0c93012406c3a1f6c74a4de1822524dcfa90f527 /mm/vmstat.c?id=77cd814835df22e177a9caac1b046f7ffdfeedd0 | |
| parent | 91e79d22be75fec88ae58d274a7c9e49d6215099 (diff) | |
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/vmstat.c?id=77cd814835df22e177a9caac1b046f7ffdfeedd0')
0 files changed, 0 insertions, 0 deletions
