Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2019 16:33:35 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r350375 - stable/12/sys/vm
Message-ID:  <201907271633.x6RGXZVW048102@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Sat Jul 27 16:33:34 2019
New Revision: 350375
URL: https://svnweb.freebsd.org/changeset/base/350375

Log:
  MFC r349841:
  Elide the vm_reserv_free_page() call when PG_PCPU_CACHE is set.

Modified:
  stable/12/sys/vm/vm_page.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_page.c
==============================================================================
--- stable/12/sys/vm/vm_page.c	Sat Jul 27 16:33:11 2019	(r350374)
+++ stable/12/sys/vm/vm_page.c	Sat Jul 27 16:33:34 2019	(r350375)
@@ -3461,7 +3461,12 @@ vm_page_free_prep(vm_page_t m)
 		pmap_page_set_memattr(m, VM_MEMATTR_DEFAULT);
 
 #if VM_NRESERVLEVEL > 0
-	if (vm_reserv_free_page(m))
+	/*
+	 * Determine whether the page belongs to a reservation.  If the page was
+	 * allocated from a per-CPU cache, it cannot belong to a reservation, so
+	 * as an optimization, we avoid the check in that case.
+	 */
+	if ((m->flags & PG_PCPU_CACHE) == 0 && vm_reserv_free_page(m))
 		return (false);
 #endif
 



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