The quilt patch titled Subject: mm-store-zero-pages-to-be-swapped-out-in-a-bitmap-v7 has been removed from the -mm tree. Its filename was mm-store-zero-pages-to-be-swapped-out-in-a-bitmap-v7.patch This patch was dropped because it was folded into mm-store-zero-pages-to-be-swapped-out-in-a-bitmap.patch ------------------------------------------------------ From: Usama Arif <usamaarif642@xxxxxxxxx> Subject: mm-store-zero-pages-to-be-swapped-out-in-a-bitmap-v7 Date: Thu, 27 Jun 2024 11:55:29 +0100 Change to kvmalloc_array for zeromap allocation instead of kvzalloc as it does an additional overflow check, and use sizeof(unsigned long) for allocation size calculation to take into account 32 bit kernels. Link: https://lkml.kernel.org/r/20240627105730.3110705-2-usamaarif642@xxxxxxxxx Signed-off-by: Usama Arif <usamaarif642@xxxxxxxxx> Cc: Chengming Zhou <chengming.zhou@xxxxxxxxx> Cc: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Cc: Nhat Pham <nphamcs@xxxxxxxxx> Cc: David Hildenbrand <david@xxxxxxxxxx> Cc: "Huang, Ying" <ying.huang@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Cc: Shakeel Butt <shakeel.butt@xxxxxxxxx> Cc: Usama Arif <usamaarif642@xxxxxxxxx> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/swapfile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/mm/swapfile.c~mm-store-zero-pages-to-be-swapped-out-in-a-bitmap-v7 +++ a/mm/swapfile.c @@ -3180,7 +3180,12 @@ SYSCALL_DEFINE2(swapon, const char __use goto bad_swap_unlock_inode; } - p->zeromap = kvzalloc(DIV_ROUND_UP(maxpages, 8), GFP_KERNEL); + /* + * Use kvmalloc_array instead of bitmap_zalloc as the allocation order might + * be above MAX_PAGE_ORDER incase of a large swap file. + */ + p->zeromap = kvmalloc_array(BITS_TO_LONGS(maxpages), sizeof(unsigned long), + GFP_KERNEL | __GFP_ZERO); if (!p->zeromap) { error = -ENOMEM; goto bad_swap_unlock_inode; _ Patches currently in -mm which might be from usamaarif642@xxxxxxxxx are mm-store-zero-pages-to-be-swapped-out-in-a-bitmap.patch mm-store-zero-pages-to-be-swapped-out-in-a-bitmap-v8.patch mm-remove-code-to-handle-same-filled-pages.patch