Date: Fri, 3 Dec 2010 22:56:31 +0000 From: RW <rwmaillists@googlemail.com> To: freebsd-hackers@freebsd.org Subject: MADV_FREE and vm_page_dontneed() Message-ID: <20101203225631.4ec30063@gumby.homeunix.com>
next in thread | raw e-mail | index | archive | help
Is there a good reason why physical memory pages released by madvise(...,MADV_FREE) get handled by vm_page_dontneed()? vm_page_dontneed() leaves page that are already in the inactive queue where they are, and otherwise distributes pages between the active queue, and the inactive queue's tail and head in the ratio 1:3:28. That seems reasonable for MADV_DONTNEED, but MADV_FREE pages are from freed dynamic memory, so passing them to vm_page_dontneed() leads to wasted pages building-up in the active and inactive queues. Wouldn't it make more sense to move all eligible MADV_FREE pages to the head of the inactive queue?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101203225631.4ec30063>