git: kernel - Refuse to swapoff under certain conditions

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Oct 5 23:29:00 PDT 2017


commit 46b71cbec8385411cb5105d75a02b8336c76b13e
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Oct 5 22:59:40 2017 -0700

    kernel - Refuse to swapoff under certain conditions
    
    * Both tmpfs and vn can't handle swapoff's method of bringing pages
      back in from the swap partition being decomissioned.
    
    * Fixing this properly is fairly involved. The normal swapoff procedure
      is to page swap into the related VM object, but tmpfs and vn use their
      VM objects ONLY to track swap blocks and not for vm_page manipulation,
      so that just won't work.  In addition, the swap code may associate
      a swap block with a VM object before issuing the write I/O to page
      out the data, and the swapoff code's asynchronous pagein might cause
      problems.
    
      For now, just make sure that swapoff refuses to remove the partition
      under these conditions, so it doesn't blow up tmpfs or vn.

Summary of changes:
 sys/dev/disk/vn/vn.c       |  1 +
 sys/vfs/tmpfs/tmpfs_subr.c |  1 +
 sys/vm/swap_pager.c        | 11 +++++++++++
 sys/vm/vm_object.h         | 15 ++++++++++-----
 4 files changed, 23 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46b71cbec8385411cb5105d75a02b8336c76b13e


-- 
DragonFly BSD source repository



More information about the Commits mailing list