vishpat
2004-07-06 18:24:01 UTC
Hello World
I know that the __get_free_pages is used to allocate KERNEL memory in
terms of PAGES while kmalloc is used to allocate arbitrary sized
CONTINOUS KERNEL memory.
However I was facing a problem when I was using "kmalloc" which got
solved when I switched over to "__get_free_pages". Even though I am
done with the problem I am curious about what was I doing wrong while
using "kmalloc". Perhaps some one can catch the flaw and let me know.
I have written a CHAR device driver which I use to export some
information from the kernel to the user space programs. Initially I
was allocating FIVE pages of kernel memory using "kmalloc" and then
locking these pages using the function "SetPageReserved". I then
memory mapped the memory in the user space. However SOMETIMES whenever
I tried reading data from the kernel my machine hung. However this
problem got solved when I switched over to "__get_free_pages" and then
could easily read the required data from the kernel.
Does anyone know the reason why must this be happening?
- Vishal
I know that the __get_free_pages is used to allocate KERNEL memory in
terms of PAGES while kmalloc is used to allocate arbitrary sized
CONTINOUS KERNEL memory.
However I was facing a problem when I was using "kmalloc" which got
solved when I switched over to "__get_free_pages". Even though I am
done with the problem I am curious about what was I doing wrong while
using "kmalloc". Perhaps some one can catch the flaw and let me know.
I have written a CHAR device driver which I use to export some
information from the kernel to the user space programs. Initially I
was allocating FIVE pages of kernel memory using "kmalloc" and then
locking these pages using the function "SetPageReserved". I then
memory mapped the memory in the user space. However SOMETIMES whenever
I tried reading data from the kernel my machine hung. However this
problem got solved when I switched over to "__get_free_pages" and then
could easily read the required data from the kernel.
Does anyone know the reason why must this be happening?
- Vishal