Author: markj
Date: Sun Feb 23 17:59:51 2020
New Revision: 358261
URL: https://svnweb.freebsd.org/changeset/base/358261

Log:
  Allow swap_pager_putpages() to allocate one block at a time.
  
  The minimum allocation size of 4 blocks is an old policy that came with
  the "new" swap pager in r42957.  Since then the blist allocator has
  gotten better at reducing fragmentation; for example, with r349777 it
  can return a range that spans multiple leaves.  When swap space is close
  to being exhaused, the minimum of 4 blocks most likely exacerbates
  memory pressure, so reduce it to 1.
  
  Reported by:  alc
  Tested by:    pho
  Reviewed by:  alc, dougm, kib
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D23763

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c    Sun Feb 23 15:21:15 2020        (r358260)
+++ head/sys/vm/swap_pager.c    Sun Feb 23 17:59:51 2020        (r358261)
@@ -1464,7 +1464,7 @@ swap_pager_putpages(vm_object_t object, vm_page_t *ma,
 
                /* Get a block of swap of size up to size n. */
                VM_OBJECT_WLOCK(object);
-               blk = swp_pager_getswapspace(&n, 4);
+               blk = swp_pager_getswapspace(&n, 1);
                if (blk == SWAPBLK_NONE) {
                        VM_OBJECT_WUNLOCK(object);
                        mtx_lock(&swbuf_mtx);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to