malloc VS kmalloc

I found the following in the documentation (which supports my understanding on malloc())

The kmalloc() function returns physically and therefore virtually contiguous memory.
This is a contrast to user space’s malloc() function, which returns virtually but not necessarily physically contiguous memory.

That documentation says that if the allocated memory need not be continuous physically (as it is used by HW) or can sleep (as cam most/all userspace request), it is recommended to use vmalloc() vfree() rather than kmalloc()/kfree()

PLEASE ELABORATE

 

באדיבות שוקי התותח בע”מ 🙂

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

Your Answer

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