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/swapfile: use plist_for_each_entry in __folio_throttle_swaprate

The loop breaks immediately after finding the first swap device and
never modifies the list. Replace plist_for_each_entry_safe() with
plist_for_each_entry() and remove the unused next variable.

Link: https://lkml.kernel.org/r/20251127100303.783198-3-youngjun.park@lge.com
Signed-off-by: Youngjun Park <youngjun.park@lge.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Acked-by: Kairui Song <kasong@tencent.com>
Acked-by: Chris Li <chrisl@kernel.org>
Cc: Barry Song <baohua@kernel.org>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Nhat Pham <nphamcs@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Youngjun Park and committed by
Andrew Morton
b60a3ef7 f9e82f99

+2 -3
+2 -3
mm/swapfile.c
··· 4023 4023 4024 4024 void __folio_throttle_swaprate(struct folio *folio, gfp_t gfp) 4025 4025 { 4026 - struct swap_info_struct *si, *next; 4026 + struct swap_info_struct *si; 4027 4027 4028 4028 if (!(gfp & __GFP_IO)) 4029 4029 return; ··· 4042 4042 return; 4043 4043 4044 4044 spin_lock(&swap_avail_lock); 4045 - plist_for_each_entry_safe(si, next, &swap_avail_head, 4046 - avail_list) { 4045 + plist_for_each_entry(si, &swap_avail_head, avail_list) { 4047 4046 if (si->bdev) { 4048 4047 blkcg_schedule_throttle(si->bdev->bd_disk, true); 4049 4048 break;