From owner-cvs-src@FreeBSD.ORG Sat Jul 26 05:58:09 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1D0A37B407; Sat, 26 Jul 2003 05:58:09 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D33643F3F; Sat, 26 Jul 2003 05:58:09 -0700 (PDT) (envelope-from mux@freebsd.org) Received: by elvis.mu.org (Postfix, from userid 1920) id 215B32ED44A; Sat, 26 Jul 2003 05:58:09 -0700 (PDT) Date: Sat, 26 Jul 2003 14:58:09 +0200 From: Maxime Henrion To: "Alan L. Cox" Message-ID: <20030726125809.GC65432@elvis.mu.org> References: <200307252102.h6PL2PFL063697@repoman.freebsd.org> <3F219CFF.ECFF953D@imimic.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="kORqDWCi7qDJ0mEj" Content-Disposition: inline In-Reply-To: <3F219CFF.ECFF953D@imimic.com> User-Agent: Mutt/1.4.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_contig.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jul 2003 12:58:10 -0000 --kORqDWCi7qDJ0mEj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Alan L. Cox wrote: > Maxime Henrion wrote: > > > > mux 2003/07/25 14:02:25 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/vm vm_contig.c > > Log: > > Add support for the M_ZERO flag to contigmalloc(). > > > > Reviewed by: jeff > > > > Revision Changes Path > > 1.21 +5 -1 src/sys/vm/vm_contig.c > > This has a bug. The page is not mapped at the time you perform > bzero(). (In fact, it is not mapped until after the vm_map_wire() > occurs.) Thus, you need to use pmap_zero_page() instead. > > Your tests probably succeeded because of page prezeroing. (With > prezeroing, you never exercised the bug.) > > I'm pretty sure that I sent you an e-mail about this. If not, I > apologize. I sent you two mails aout this, specifically asking if I was allowed to touch the page before vm_map_wire() was called, because I was pretty sure nothing else could be wrong in this patch :-). I never received your answer, so maybe it got lost, but anyways, here is a patch which should fix this issue. Does this look OK to you? Thanks, Maxime --kORqDWCi7qDJ0mEj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vm_contig.patch.2" Index: vm_contig.c =================================================================== RCS file: /space2/ncvs/src/sys/vm/vm_contig.c,v retrieving revision 1.21 diff -u -p -r1.21 vm_contig.c --- vm_contig.c 25 Jul 2003 21:02:25 -0000 1.21 +++ vm_contig.c 26 Jul 2003 12:57:03 -0000 @@ -261,7 +261,7 @@ again1: vm_page_insert(m, kernel_object, OFF_TO_IDX(tmp_addr - VM_MIN_KERNEL_ADDRESS)); if ((flags & M_ZERO) && !(m->flags & PG_ZERO)) - bzero((void *)tmp_addr, PAGE_SIZE); + pmap_zero_page(m); m->flags = 0; tmp_addr += PAGE_SIZE; } --kORqDWCi7qDJ0mEj--