diff options
author | Ma Wupeng <mawupeng1@huawei.com> | 2023-06-27 20:08:32 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-08-18 10:12:00 -0700 |
commit | 67490031e83a008c5ce8f562e7fa3b6b83adc861 (patch) | |
tree | 810526eb0bc7c36ff7576f27802e22bfd667af2a /mm/swapfile.c | |
parent | 87b11f862254396a93636f0998377ac3f6648f5f (diff) | |
download | lwn-67490031e83a008c5ce8f562e7fa3b6b83adc861.tar.gz lwn-67490031e83a008c5ce8f562e7fa3b6b83adc861.zip |
swap: cleanup duplicated WARN_ON in add_to_avail_list
Patch series "fix WARN_ON in add_to_avail_list".
Empty check for plist_node is checked in add_to_avail_list and plist_add.
Drop the duplicate one in add_to_avail_list.
Link: https://lkml.kernel.org/r/20230627120833.2230766-1-mawupeng1@huawei.com
Link: https://lkml.kernel.org/r/20230627120833.2230766-2-mawupeng1@huawei.com
Signed-off-by: Ma Wupeng <mawupeng1@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 8e6dde68b389..2a4693642071 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -714,10 +714,8 @@ static void add_to_avail_list(struct swap_info_struct *p) int nid; spin_lock(&swap_avail_lock); - for_each_node(nid) { - WARN_ON(!plist_node_empty(&p->avail_lists[nid])); + for_each_node(nid) plist_add(&p->avail_lists[nid], &swap_avail_heads[nid]); - } spin_unlock(&swap_avail_lock); } |