]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm persistent data: fix memory allocation failure
authorMikulas Patocka <mpatocka@redhat.com>
Tue, 13 Aug 2024 14:35:14 +0000 (16:35 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Tue, 13 Aug 2024 19:14:21 +0000 (21:14 +0200)
commitfaada2174c08662ae98b439c69efe3e79382c538
treec118c8bfc77f51885b91d37aa666ad2da15b8589
parent86cfa9a85fb04fa61e7c6b5a8ecf812437cdad78
dm persistent data: fix memory allocation failure

kmalloc is unreliable when allocating more than 8 pages of memory. It may
fail when there is plenty of free memory but the memory is fragmented.
Zdenek Kabelac observed such failure in his tests.

This commit changes kmalloc to kvmalloc - kvmalloc will fall back to
vmalloc if the large allocation fails.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Cc: stable@vger.kernel.org
drivers/md/persistent-data/dm-space-map-metadata.c