mm/swap: remove boilerplate
authorYu Zhao <yuzhao@google.com>
Thu, 11 Jul 2024 02:13:17 +0000 (20:13 -0600)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:25:48 +0000 (20:25 -0700)
commitafb6d780b9b17914ba720088dac2bfa2505f36c8
tree7c1b6ce76fb1c8e9ee9a0844b188ca4bad979ab2
parentbed71b50b0c2dc38c5e94c84dd660add2d1609e0
mm/swap: remove boilerplate

Remove boilerplate by using a macro to choose the corresponding lock and
handler for each folio_batch in cpu_fbatches.

[yuzhao@google.com: handle zero-length local_lock_t]
Link: https://lkml.kernel.org/r/Zq_0X04WsqgUnz30@google.com
[yuzhao@google.com: fix "BUG: using smp_processor_id() in preemptible"]
Link: https://lkml.kernel.org/r/ZqNHHMiHn-9vy_II@google.com
Link: https://lkml.kernel.org/r/20240711021317.596178-6-yuzhao@google.com
Signed-off-by: Yu Zhao <yuzhao@google.com>
Tested-by: Hugh Dickins <hughd@google.com>
Cc: Barry Song <21cnbao@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap.c