Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jul 2020 08:42:16 +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: r363444 - head/sys/vm
Message-ID:  <202007230842.06N8gGHB096344@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Thu Jul 23 08:42:16 2020
New Revision: 363444
URL: https://svnweb.freebsd.org/changeset/base/363444

Log:
  vm: annotate swap_reserved with __exclusive_cache_line
  
  The counter keeps being updated all the time and variables read afterwards
  share the cacheline. Note this still fundamentally does not scale and needs
  to be replaced, in the meantime gets a bandaid.
  
  brk1_processes -t 52 ops/s:
  before: 8598298
  after:  9098080

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Thu Jul 23 03:25:31 2020	(r363443)
+++ head/sys/vm/swap_pager.c	Thu Jul 23 08:42:16 2020	(r363444)
@@ -152,7 +152,7 @@ static int nswapdev;		/* Number of swap devices */
 int swap_pager_avail;
 static struct sx swdev_syscall_lock;	/* serialize swap(on|off) */
 
-static u_long swap_reserved;
+static __exclusive_cache_line u_long swap_reserved;
 static u_long swap_total;
 static int sysctl_page_shift(SYSCTL_HANDLER_ARGS);
 



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