Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/shmem: remove unused entry_order after large swapin rework

After commit 93c0476e7057 ("mm/shmem, swap: rework swap entry and index
calculation for large swapin"), xas_get_order() will never return a
non-zero value for `entry_order` in shmem_split_large_entry(). As a
result, the local variable `entry_order` is effectively unused.

Clean up the code by removing `entry_order` and directly using
`cur_order`. This change is purely a refactor and has no functional
impact.

No functional change intended.

Link: https://lkml.kernel.org/r/20250908062614.89880-1-liu.yun@linux.dev
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Jackie Liu and committed by
Andrew Morton
5919f128 6ce3bc99

+4 -7
+4 -7
mm/shmem.c
··· 2173 2173 { 2174 2174 struct address_space *mapping = inode->i_mapping; 2175 2175 XA_STATE_ORDER(xas, &mapping->i_pages, index, 0); 2176 - int split_order = 0, entry_order; 2176 + int split_order = 0; 2177 2177 int i; 2178 2178 2179 2179 /* Convert user data gfp flags to xarray node gfp flags */ ··· 2191 2191 goto unlock; 2192 2192 } 2193 2193 2194 - entry_order = xas_get_order(&xas); 2195 - 2196 - if (!entry_order) 2194 + cur_order = xas_get_order(&xas); 2195 + if (!cur_order) 2197 2196 goto unlock; 2198 2197 2199 2198 /* Try to split large swap entry in pagecache */ 2200 - cur_order = entry_order; 2201 - swap_index = round_down(index, 1 << entry_order); 2202 - 2199 + swap_index = round_down(index, 1 << cur_order); 2203 2200 split_order = xas_try_split_min_order(cur_order); 2204 2201 2205 2202 while (cur_order > 0) {