]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/dasd: Replace get_zeroed_page() with kzalloc()
authorMike Rapoport (Microsoft) <rppt@kernel.org>
Sun, 31 May 2026 14:08:23 +0000 (17:08 +0300)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 3 Jun 2026 13:32:44 +0000 (15:32 +0200)
commit50548b70771922222bc70f97bf17ee83064bbd2a
treee699a78dcced44dad954b87a76c5a32d3d434d62
parent16679621ef3f630f976af97d9e9c0b4e132041ec
s390/dasd: Replace get_zeroed_page() with kzalloc()

DASD driver uses get_zeroed_page() to allocate pages for the Extended Error
Reporting software ring buffer and for a scratch buffer for formatting
sense dump diagnostic text.

These buffers can be allocated with kmalloc() as there's nothing special
about it to go directly to the page allocator.

kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.

Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.

For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.

Replace use of get_zeroed_page() with kzalloc() and free_page() with
kfree().

Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
drivers/s390/block/dasd_eckd.c
drivers/s390/block/dasd_eer.c