Messages in this thread | | | From | "Raj, Ashok" <> | Subject | FW: get_free_pages... and free_pages.. | Date | Tue, 17 Aug 1999 18:45:58 -0700 |
| |
Hello.. iam trying again since noone replied.
could someone tell me if iam doing something wrong or why the memory is not being reclaimed by calling free_pages?
thanks in advance ashokr
-----Original Message----- From: Raj, Ashok [mailto:ashok.raj@intel.com] Sent: Monday, August 16, 1999 8:38 AM To: Linux-Kernel (E-mail) Cc: Raj, Ashok Subject: get_free_pages... and free_pages..
Hello.
I need my test driver to allocate some memory that is physically contigues. the way i do it is
user program issues a mmap() call to the driver with a specific offset. when this value is identified in the kernel the driver does the following.
kernel: buf = __get_free_pages(...); for (i = MAP_NR(buf); i<=MAP_NR(buf + size -1);i++) set_bit(PG_reserved, &mem_map[i].flags); paddr = __pa(buf); if (remap_page_range(vma->vm_start, paddr, size, vma->vm_page_prot)) return -EAGAIN; else return 0;
when the user process closes the handle while the release() procedure is getting called i do the reverse of the above
- clear_bit(PG_reserved) - free_pages()
this seems to work fine, except that after the free pages still i dont see the available memory increasing in /proc/meminfo. so the memory leaks and finally iam not able to allocate using __get_free_pages(). is something wrong here from what iam doing?
ashokr
Cheers, ashokr
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |