]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dm-bufio: use kmalloc to allocate power-of-two sized buffers
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 18 Nov 2024 15:14:27 +0000 (16:14 +0100)
committerMikulas Patocka <mpatocka@redhat.com>
Wed, 20 Nov 2024 10:44:23 +0000 (11:44 +0100)
commit61a57254a942705ca0a13d71a0b8387b299a65da
tree1c9daa734650dff2b7e15222007fb7c581856a4f
parente74fa2447bf9ed03d085b6d91f0256cc1b53f1a8
dm-bufio: use kmalloc to allocate power-of-two sized buffers

Vlastimil Babka said [1] that kmalloc will return a power-of-two-aligned
buffer if it was called with a power-of-two size. So, we can use kmalloc
instead of our own slab cache in dm-bufio. Note that the code for the
slab cache was not removed because dm-bufio supports non-power-of-two
buffer sizes.

Link: https://lore.kernel.org/linux-mm/e7fca292-7c79-4f97-a90c-d68178d8ca59@suse.cz/
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
drivers/md/dm-bufio.c