Date: Fri, 27 Nov 2009 22:08:29 +0000 (UTC) From: Alan Cox <alc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r199869 - head/sys/vm Message-ID: <200911272208.nARM8TRB031039@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: alc Date: Fri Nov 27 22:08:29 2009 New Revision: 199869 URL: http://svn.freebsd.org/changeset/base/199869 Log: Support the new VM_PROT_COPY option on wired pages. The effect of which is that a debugger can now set a breakpoint in a program that uses mlock(2) on its text segment or mlockall(2) on its entire address space. Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Fri Nov 27 20:24:11 2009 (r199868) +++ head/sys/vm/vm_fault.c Fri Nov 27 22:08:29 2009 (r199869) @@ -273,7 +273,7 @@ RetryFault:; fs.lookup_still_valid = TRUE; if (wired) - fault_type = prot; + fault_type = prot | (fault_type & VM_PROT_COPY); fs.first_m = NULL; @@ -759,8 +759,11 @@ vnode_locked: */ pmap_copy_page(fs.m, fs.first_m); fs.first_m->valid = VM_PAGE_BITS_ALL; - } - if (fs.m) { + if (wired && (fault_flags & + VM_FAULT_CHANGE_WIRING) == 0) { + vm_page_wire(fs.first_m); + vm_page_unwire(fs.m, FALSE); + } /* * We no longer need the old page or object. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911272208.nARM8TRB031039>