Re: [PATCH v2 2/4] mm/shmem, swap: avoid redundant Xarray lookup during swapin

From: Baolin Wang
Date: Sat Jun 21 2025 - 00:27:53 EST




On 2025/6/20 01:55, Kairui Song wrote:
From: Kairui Song <kasong@xxxxxxxxxxx>

Currently shmem calls xa_get_order to get the swap radix entry order,
requiring a full tree walk. This can be easily combined with the swap
entry value checking (shmem_confirm_swap) to avoid the duplicated
lookup, which should improve the performance.

Signed-off-by: Kairui Song <kasong@xxxxxxxxxxx>
Reviewed-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>