Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 2014 14:27:05 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269190 - in head/sys: dev/md kern
Message-ID:  <201407281427.s6SER5gh088632@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Mon Jul 28 14:27:05 2014
New Revision: 269190
URL: http://svnweb.freebsd.org/changeset/base/269190

Log:
  For md(4), posix shm(3) and tmpfs(5), free swap space used by paged in
  dirty page, which is written by the process.
  
  Reviewed by:	alc
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/sys/dev/md/md.c
  head/sys/kern/uipc_shm.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c	Mon Jul 28 14:24:18 2014	(r269189)
+++ head/sys/dev/md/md.c	Mon Jul 28 14:27:05 2014	(r269190)
@@ -895,8 +895,10 @@ mdstart_swap(struct md_s *sc, struct bio
 		else
 			vm_page_activate(m);
 		vm_page_unlock(m);
-		if (bp->bio_cmd == BIO_WRITE)
+		if (bp->bio_cmd == BIO_WRITE) {
 			vm_page_dirty(m);
+			vm_pager_page_unswapped(m);
+		}
 
 		/* Actions on further pages start at offset 0 */
 		p += PAGE_SIZE - offs;

Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c	Mon Jul 28 14:24:18 2014	(r269189)
+++ head/sys/kern/uipc_shm.c	Mon Jul 28 14:27:05 2014	(r269190)
@@ -199,6 +199,7 @@ uiomove_object_page(vm_object_t obj, siz
 	if (uio->uio_rw == UIO_WRITE && error == 0) {
 		VM_OBJECT_WLOCK(obj);
 		vm_page_dirty(m);
+		vm_pager_page_unswapped(m);
 		VM_OBJECT_WUNLOCK(obj);
 	}
 	vm_page_lock(m);



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