Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 07 Jul 2002 14:27:07 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Alan Cox <alc@cs.rice.edu>
Cc:        Jake Burkholder <jake@locore.ca>, Alan Cox <alc@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm vm_zeroidle.c 
Message-ID:  <20020707212707.BD3713808@overcee.wemm.org>
In-Reply-To: <20020707211530.GZ11391@cs.rice.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
Alan Cox wrote:
> On Sun, Jul 07, 2002 at 04:11:06PM -0400, Jake Burkholder wrote:
> > Apparently, On Sun, Jul 07, 2002 at 02:37:42PM -0500,
> > 	Alan Cox said words to the effect of;
> > 
> > > On Sun, Jul 07, 2002 at 12:27:57PM -0700, Alan Cox wrote:
> > > > alc         2002/07/07 12:27:57 PDT
> > > > 
> > > >   Modified files:
> > > >     sys/vm               vm_zeroidle.c 
> > > >   Log:
> > > >    o Lock accesses to the free queue(s) in vm_page_zero_idle().
> > > >   
> > > >   Revision  Changes    Path
> > > >   1.10      +4 -0      src/sys/vm/vm_zeroidle.c
> > > 
> > > I believe that Giant could be removed from vm_page_zero_idle()
> > > on alpha and ia64.  i386's pmap_zero_page() is not MPSAFE.
> > > I'm not sure about sparc64.
> > 
> > (re sparc64)
> > 
> > The cache flush call is not MP-safe yet, because the IPI code isn't,
> > but it won't take much to make it so.  To do the zeroing it accesses
> > physical addresses directly, similar to K0SEG addresses on alpha and
> > RR7 addresses on ia64, which is MP-safe.
> 
> We should really try to avoid generating IPI's from vm_page_zero_idle().
> 
> Perhaps a thread private KVA ... 

Thats what I did to avoid reentrancy problems.  The zeroidle process uses
CMAP3 on x86.  (ugh! why not allocate some kvm? hmmm).

However, with preemption, we can end up on another cpu.  Or, we get
scheduled on a different cpu next time.  If we had a way to pin a khread to
a particular cpu, now that would be nice.  We could get in, pin ourselves,
do our mappings, zero the page, unmap, unpin and done.  No preemption
problems to worry about then, and no need to worry about coherency on other
cpus since this is explicitly single threaded.

I believe John Baldwin has code to do this.  Hmm....

Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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