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/swap_state.c: optimize the code in clear_shadow_from_swap_cache()

Use ALIGN to achieve the same effect and simplify the code.

Link: https://lkml.kernel.org/r/20250205092721.9395-3-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Kairui Song <ryncsn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Baoquan He and committed by
Andrew Morton
cd57a3fb 81fe88a9

+1 -3
+1 -3
mm/swap_state.c
··· 270 270 xa_unlock_irq(&address_space->i_pages); 271 271 272 272 /* search the next swapcache until we meet end */ 273 - curr >>= SWAP_ADDRESS_SPACE_SHIFT; 274 - curr++; 275 - curr <<= SWAP_ADDRESS_SPACE_SHIFT; 273 + curr = ALIGN((curr + 1), SWAP_ADDRESS_SPACE_PAGES); 276 274 if (curr > end) 277 275 break; 278 276 }