summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorMike Rapoport (Microsoft) <rppt@kernel.org>2026-08-31 11:27:44 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-23 14:43:58 +0200
commitcdf5e6ea0d4443b20f6182ec012006f59b7848b9 (patch)
treeb376bca7b94c24079f965ff53d5b9baf877dd053 /tools/lib/python
parentcbfd7a22a7cb3ad06a1349aebae26b86ed861d1f (diff)
serial: core: replace get_zeroed_page() with kzalloc()
uart_alloc_xmit_buf() allocates the transmit buffer of a serial port. The buffer only backs the port's kfifo, the data being sent is copied in and out of it. This buffer 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. While on it, make the local variable holding the buffer a pointer to get rid of the casts. 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 Assisted-by: copilot:claude-opus Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org> Link: https://patch.msgid.link/20260831-tty-v2-2-88cd58c3c640@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions