lkml.org 
[lkml]   [1999]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectFW: get_free_pages... and free_pages..
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.024 / U:1.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site