Thread (25 messages) flat view 25 messages, 5 authors, 15d ago

Re: [PATCH 2/4] char: xillybus: replace __get_free_pages() with kmalloc()

From: Eli Billauer <eli.billauer@gmail.com>
Date: 2026-09-04 15:29:21
Also in: linux-mm, lkml

On 03/09/2026 16:28, Vlastimil Babka (SUSE) wrote:
quoted
Replacing it with a kmalloc() is confusing in my opinion, and requires
that the reader is aware that kmalloc() falls back to __get_free_pages()
Why? The reader has only to know that kmalloc() will provide such a buffer
(up to sizes that the page allocator would) and whether it falls back to the
page allocator or not is an implementation detail.
When I see __get_free_pages(), I automatically assume there is some ugly 
low-level memory management going on, which is exactly what fifo_init() 
does. kmalloc() feels like something you use more for allocating memory 
for a struct. There is no such rule, of course, but this is my 
subjective view on these two functions. As I wrote earlier, this is a 
matter of taste. Maybe it's only me thinking like that.

And as I'm not the one deciding whether this patch is applied or not, it 
doesn't matter so much what I think about this matter. I've humbly 
voiced my opinion, and that's about as much as I can do.

Regards,
    Eli
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help