Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Apr 2003 13:28:11 -0400 (EDT)
From:      Andrew Gallatin <gallatin@cs.duke.edu>
To:        Nate Lawson <nate@root.org>
Cc:        current@freebsd.org
Subject:   Re: mbuf LOR
Message-ID:  <16020.22571.349778.196862@grasshopper.cs.duke.edu>
In-Reply-To: <Pine.BSF.4.21.0304091021530.29923-100000@root.org>
References:  <16013.49267.867140.38329@grasshopper.cs.duke.edu> <Pine.BSF.4.21.0304091021530.29923-100000@root.org>

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

Nate Lawson writes:
 > On Fri, 4 Apr 2003, Andrew Gallatin wrote:
 > > The following patch boots & passed the basic 'make -j16 buildworld'
 > > test on x86 SMP.  As I outlined before, I'm not certain if it is safe
 > > on all platforms.
 > > 
 > > Index: vm/uma_core.c
 > > ===================================================================
 > > RCS file: /home/ncvs/src/sys/vm/uma_core.c,v
 > > retrieving revision 1.51
 > > diff -u -r1.51 uma_core.c
 > > --- vm/uma_core.c	26 Mar 2003 18:44:53 -0000	1.51
 > > +++ vm/uma_core.c	4 Apr 2003 15:11:34 -0000
 > > @@ -703,10 +703,15 @@
 > >  		wait &= ~M_ZERO;
 > >  
 > >  	if (booted || (zone->uz_flags & UMA_ZFLAG_PRIVALLOC)) {
 > > -		mtx_lock(&Giant);
 > > -		mem = zone->uz_allocf(zone, 
 > > -		    zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait);
 > > -		mtx_unlock(&Giant);
 > > +		if ((wait & M_NOWAIT) == 0) {
 > > +			mtx_lock(&Giant);
 > > +			mem = zone->uz_allocf(zone, 
 > > +			    zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait);
 > > +			mtx_unlock(&Giant);
 > > +		} else {
 > > +			mem = zone->uz_allocf(zone, 
 > > +			    zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait);
 > > +		}
 > >  		if (mem == NULL) {
 > >  			ZONE_LOCK(zone);
 > >  			return (NULL);
 > 
 > I have been running with this patch for days with MPSAFE and it works
 > fine.  Will you commit it at some point?  Can the non-i386 platform heads
 > chime in?

I'd really prefer that Jeff reviewed it, as I'm not 100% familiar with the
code.   I seem to remember that he's out of town for a week.

Drew



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