Re: [PATCH 3/4] mwifiex: debugfs: use kzalloc() to allocate formatting buffers
Francesco Dolcini <[email protected]> Wed, 1 Jul 2026 18:24:05 +0200
| Newsgroups | org.infradead.lists.b43-dev,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kvack.linux-mm |
|---|---|
| Message-ID | <20260701162405.GA38581@francesco-nb> |
+Jeff Jeff: this is relevant also for nxpwifi. On Wed, Jul 01, 2026 at 04:59:12PM +0300, Mike Rapoport (Microsoft) wrote: > mwifiex debugfs functions allocate buffers for formatting debug output > text using get_zeroed_page(). > > These buffers can be allocated with kmalloc() as there's nothing special > about them 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/[email protected] > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> Reviewed-by: Francesco Dolcini <[email protected]> _______________________________________________ b43-dev mailing list [email protected] http://lists.infradead.org/mailman/listinfo/b43-dev