Files
linux/mm
Kemeng Shi 64944ef6a1 mm: swap: enable swap_entry_range_free() to drop any kind of last ref
The original VM_BUG_ON only allows swap_entry_range_free() to drop last
SWAP_HAS_CACHE ref.  By allowing other kind of last ref in VM_BUG_ON,
swap_entry_range_free() could be a more general-purpose function able to
handle all kind of last ref.  Following thi change, also rename
swap_entry_range_free() to swap_entries_free() and update it's comment
accordingly.

This is a preparation to use swap_entries_free() to drop more kind of last
ref other than SWAP_HAS_CACHE.

[shikemeng@huaweicloud.com: add __maybe_unused attribute for swap_is_last_ref() and update comment]
  Link: https://lkml.kernel.org/r/20250410153908.612984-1-shikemeng@huaweicloud.com
Link: https://lkml.kernel.org/r/20250325162528.68385-3-shikemeng@huaweicloud.com
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
Reviewed-by: Baoquan He <bhe@redhat.com>
Tested-by: SeongJae Park <sj@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-05-11 17:48:12 -07:00
..
2025-05-11 17:48:04 -07:00
2025-03-17 22:07:05 -07:00
2024-11-03 01:28:06 -05:00
2025-03-17 22:06:39 -07:00
2025-05-11 17:48:04 -07:00
2025-04-06 10:00:04 -07:00
2025-05-11 17:48:04 -07:00
2025-05-11 17:48:04 -07:00
2025-03-17 22:06:39 -07:00
2025-01-13 22:40:51 -08:00
2024-07-10 12:14:54 -07:00
2025-01-27 19:25:45 -05:00
2025-05-11 17:48:03 -07:00