0

Although there are many threads already running on kmalloc and vmalloc but I did not get my exact answer so I am putting it here.

As far I know,

kmalloc : It is kernel API which allocates physically as well virtually contiguous memory.

vmalloc : It is kernel API which allocates physically non contiguous but virtually contiguous memory.

Now my question is : In both cases (kmalloc or vmalloc) address or say pointer returned by both APIs is LOGICAL ADDRESS correct ?

Memory Management has always been grey part for me in linux kernel so please correct me if my understanding is wrong.

Nishith Goswami
  • 353
  • 5
  • 13

1 Answers1

1

Yes, the pointer can be dereferenced in your code to access the allocated memory.

Those functions that return another kind of memory reference do not return void* I think. They usually return unsigned long or typedef'd types.

Andreas Bombe
  • 2,450
  • 13
  • 20
  • The term "Logical Address" can introduce some confusion..think of them simply as virtual addresses (in the case of the question, within the kernel virtual address space). – kaiwan Apr 14 '14 at 04:46