From 78afdce6af03e1f816966c34a5c96b90881a6c5f Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 14 Jun 2015 05:23:39 +0000 Subject: [PATCH] As the next step in eliminating PG_CACHE pages, free rather than cache pages in vm_pageout_scan(). The reactivation rate of cache pages created by vm_pageout_scan() is extremely low; typically no more than 0.5% to 2.25% of the pages are ever reactivated. At the same time, caching pages is more expensive than freeing them. For example, in a test with PostgreSQL, this change reduced the amount of time spent in the inactive queue scan by 1/6. Differential Revision: https://reviews.freebsd.org/D2805 Reviewed by: kib Sponsored by: EMC / Isilon Storage Division --- sys/vm/vm_pageout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 71d76d495ec2..6bfd50ca0f5f 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -1233,10 +1233,10 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) --page_shortage; } else if (m->dirty == 0) { /* - * Clean pages can be placed onto the cache queue. - * This effectively frees them. + * Clean pages can be freed. */ - vm_page_cache(m); + vm_page_free(m); + PCPU_INC(cnt.v_dfree); --page_shortage; } else if ((m->flags & PG_WINATCFLS) == 0 && pass < 2) { /*