Author: alc
Date: Tue Jun  6 16:52:07 2017
New Revision: 319627
URL: https://svnweb.freebsd.org/changeset/base/319627

Log:
  Starting in r118390, swaponsomething() began to reserve the blocks at the
  beginning of a swap area for a disk label.  However, neither r118390 nor
  r118544, which increased the reservation from one to two blocks, correctly
  accounted for these blocks when updating the variable "swap_pager_avail".
  This change corrects that error.
  
  Reviewed by:  kib
  MFC after:    5 days

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c    Tue Jun  6 16:04:27 2017        (r319626)
+++ head/sys/vm/swap_pager.c    Tue Jun  6 16:52:07 2017        (r319627)
@@ -2203,7 +2203,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nbl
        sp->sw_end = dvbase + nblks;
        TAILQ_INSERT_TAIL(&swtailq, sp, sw_list);
        nswapdev++;
-       swap_pager_avail += nblks;
+       swap_pager_avail += nblks - 2;
        swap_total += (vm_ooffset_t)nblks * PAGE_SIZE;
        swapon_check_swzone(swap_total / PAGE_SIZE);
        swp_sizecheck();
_______________________________________________
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