From d9ccb9a89f547088fc6171ef8901ad5502dddb51 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 2 Oct 2017 07:14:32 +0000 Subject: [PATCH] When mdstart_swap() accesses a page that is already in the active queue, mark the page as referenced rather than calling vm_page_activate(). This allows the page's act_count to grow beyond ACT_INIT and better reflect its usage. (See also r324146, which modified a function used by tmpfs, uiomove_object_page(), to behave in the same way.) Reviewed by: kib, markj MFC after: 2 weeks --- sys/dev/md/md.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index d9c41f130235..9d909211476f 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1111,7 +1111,10 @@ mdstart_swap(struct md_s *sc, struct bio *bp) if (m != NULL) { vm_page_xunbusy(m); vm_page_lock(m); - vm_page_activate(m); + if (vm_page_active(m)) + vm_page_reference(m); + else + vm_page_activate(m); vm_page_unlock(m); }