Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 2003 14:58:09 +0200
From:      Maxime Henrion <mux@freebsd.org>
To:        "Alan L. Cox" <alc@imimic.com>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm vm_contig.c
Message-ID:  <20030726125809.GC65432@elvis.mu.org>
In-Reply-To: <3F219CFF.ECFF953D@imimic.com>
References:  <200307252102.h6PL2PFL063697@repoman.freebsd.org> <3F219CFF.ECFF953D@imimic.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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