kmalloc VS __get_free_pages()

what is the difference between kmalloc and __get_free_pages()?

When googling I see some complaining about issues that came up by using kmalloc that were resolved when switching to *__get_free_pages()

BTW – I asked what is kmalloc(GFP_USER, xxx)

I found an answer which seems to make sense:

GFP_USER is for userspace allocations that also need to be directly accessibly by the kernel or hardware.
It is typically used by hardware for buffers that are mapped to userspace (e.g. graphics) that hardware
still must DMA to. cpuset limits are enforced for these allocations.

באדיבות שוקי התותח 🙂

Asked on October 10, 2019 in Linux Kernel.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.