Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 2019 23:19:10 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353293 - head/sys/vm
Message-ID:  <201910072319.x97NJAEj089384@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Mon Oct  7 23:19:09 2019
New Revision: 353293
URL: https://svnweb.freebsd.org/changeset/base/353293

Log:
  vm: stop trylocking page queues in vm_page_pqbatch_submit
  
  About 11 minutes of poudriere -s -j 104 and probing on return value of
  trylocks reveals that over 10% of attempts fail, which in turn means
  there are more atomics performed than necessary.
  
  Trylocking was there to try preventing migration, but it's not very likely
  to happen if the lock is uncontested.
  
  Reviewed by:	markj
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D21925

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Mon Oct  7 22:40:05 2019	(r353292)
+++ head/sys/vm/vm_page.c	Mon Oct  7 23:19:09 2019	(r353293)
@@ -3216,12 +3216,10 @@ vm_page_pqbatch_submit(vm_page_t m, uint8_t queue)
 		critical_exit();
 		return;
 	}
-	if (!vm_pagequeue_trylock(pq)) {
-		critical_exit();
-		vm_pagequeue_lock(pq);
-		critical_enter();
-		bq = DPCPU_PTR(pqbatch[domain][queue]);
-	}
+	critical_exit();
+	vm_pagequeue_lock(pq);
+	critical_enter();
+	bq = DPCPU_PTR(pqbatch[domain][queue]);
 	vm_pqbatch_process(pq, bq, queue);
 
 	/*



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