From owner-svn-src-head@FreeBSD.ORG Wed Oct 24 18:22:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D117A23; Wed, 24 Oct 2012 18:22:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 457FF8FC0C; Wed, 24 Oct 2012 18:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9OIM01I070642; Wed, 24 Oct 2012 18:22:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9OIM0IF070638; Wed, 24 Oct 2012 18:22:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210241822.q9OIM0IF070638@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 24 Oct 2012 18:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242011 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 18:22:00 -0000 Author: kib Date: Wed Oct 24 18:21:59 2012 New Revision: 242011 URL: http://svn.freebsd.org/changeset/base/242011 Log: Dirty the newly copied anonymous pages after the wired region is forked. Otherwise, pagedaemon might reclaim the page without saving its content into the swap file, resulting in the valid content replaced by zeroes. Reported and tested by: pho Reviewed and comment update by: alc MFC after: 1 week Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Oct 24 18:21:22 2012 (r242010) +++ head/sys/vm/vm_fault.c Wed Oct 24 18:21:59 2012 (r242011) @@ -1287,9 +1287,11 @@ vm_fault_copy_entry(vm_map_t dst_map, vm access &= ~VM_PROT_WRITE; /* - * Loop through all of the pages in the entry's range, copying each - * one from the source object (it should be there) to the destination - * object. + * Loop through all of the pages in the entry's range, copying + * each one from the source object (it should be there) to the + * destination object. Note that copied pages are not wired + * and marked dirty to prevent reclamation without saving the + * content into the swap file on pageout. */ for (vaddr = dst_entry->start, dst_pindex = 0; vaddr < dst_entry->end; @@ -1332,6 +1334,7 @@ vm_fault_copy_entry(vm_map_t dst_map, vm pmap_copy_page(src_m, dst_m); VM_OBJECT_UNLOCK(object); dst_m->valid = VM_PAGE_BITS_ALL; + dst_m->dirty = VM_PAGE_BITS_ALL; VM_OBJECT_UNLOCK(dst_object); /*