diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2022-05-20 00:08:51 +0300 |
---|---|---|
committer | akpm <akpm@linux-foundation.org> | 2022-05-20 00:08:51 +0300 |
commit | f19c25684c3e19b329e0498dd6d601df13c33223 (patch) | |
tree | 0c371bdf09f8f3aedddf55216d947e055cfe263a | |
parent | 23b230ba8ac30d334afd249c9763e0d0ca583e43 (diff) | |
download | linux-f19c25684c3e19b329e0498dd6d601df13c33223.tar.xz |
mm/swap: remove buggy cache->nr check in refill_swap_slots_cache
refill_swap_slots_cache is always called when cache->nr is 0. So remove
such buggy and confusing check.
Link: https://lkml.kernel.org/r/20220509131416.17553-7-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: NeilBrown <neilb@suse.de>
Cc: Peter Xu <peterx@redhat.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/swap_slots.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swap_slots.c b/mm/swap_slots.c index 2f877e6f87d7..2a65a89b5b4d 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -258,7 +258,7 @@ out_unlock: /* called with swap slot cache's alloc lock held */ static int refill_swap_slots_cache(struct swap_slots_cache *cache) { - if (!use_swap_slot_cache || cache->nr) + if (!use_swap_slot_cache) return 0; cache->cur = 0; |