Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2017 13:23:59 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323704 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201709181323.v8IDNxB6056215@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Mon Sep 18 13:23:59 2017
New Revision: 323704
URL: https://svnweb.freebsd.org/changeset/base/323704

Log:
  Only wire pages in the LinuxKPI instead of holding and wiring them.
  This prevents the page daemon from regularly scanning the held pages.
  
  Suggested by:		kib @
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/mm.h
  head/sys/compat/linuxkpi/common/src/linux_page.c

Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/mm.h	Mon Sep 18 13:17:23 2017	(r323703)
+++ head/sys/compat/linuxkpi/common/include/linux/mm.h	Mon Sep 18 13:23:59 2017	(r323704)
@@ -220,7 +220,6 @@ static inline void
 get_page(struct vm_page *page)
 {
 	vm_page_lock(page);
-	vm_page_hold(page);
 	vm_page_wire(page);
 	vm_page_unlock(page);
 }
@@ -245,7 +244,6 @@ put_page(struct vm_page *page)
 {
 	vm_page_lock(page);
 	vm_page_unwire(page, PQ_ACTIVE);
-	vm_page_unhold(page);
 	vm_page_unlock(page);
 }
 

Modified: head/sys/compat/linuxkpi/common/src/linux_page.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_page.c	Mon Sep 18 13:17:23 2017	(r323703)
+++ head/sys/compat/linuxkpi/common/src/linux_page.c	Mon Sep 18 13:23:59 2017	(r323704)
@@ -209,6 +209,7 @@ linux_get_user_pages_internal(vm_map_t map, unsigned l
 
 		vm_page_lock(pg);
 		vm_page_wire(pg);
+		vm_page_unhold(pg);
 		vm_page_unlock(pg);
 	}
 	return (nr_pages);
@@ -243,6 +244,7 @@ __get_user_pages_fast(unsigned long start, int nr_page
 
 		vm_page_lock(*mp);
 		vm_page_wire(*mp);
+		vm_page_unhold(*mp);
 		vm_page_unlock(*mp);
 
 		if ((prot & VM_PROT_WRITE) != 0 &&
@@ -323,9 +325,6 @@ linux_shmem_read_mapping_page_gfp(vm_object_t obj, int
 		}
 		vm_page_xunbusy(page);
 	}
-	vm_page_lock(page);
-	vm_page_hold(page);
-	vm_page_unlock(page);
 	VM_OBJECT_WUNLOCK(obj);
 	return (page);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709181323.v8IDNxB6056215>