Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 May 2002 13:05:34 -0400
From:      Jake Burkholder <jake@locore.ca>
To:        Jonathan Mini <mini@freebsd.org>
Cc:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   Re: PERFORCE change 11120 for review
Message-ID:  <20020510130534.E2566@locore.ca>
In-Reply-To: <20020510095040.I43682@stylus.haikugeek.com>; from mini@freebsd.org on Fri, May 10, 2002 at 09:50:40AM -0700
References:  <200205101530.g4AFUn510685@freefall.freebsd.org> <20020510123716.D2566@locore.ca> <20020510095040.I43682@stylus.haikugeek.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Apparently, On Fri, May 10, 2002 at 09:50:40AM -0700,
	Jonathan Mini said words to the effect of;

> Jake Burkholder [jake@locore.ca] wrote :
> 
> > Apparently, On Fri, May 10, 2002 at 08:30:49AM -0700,
> > 	Jonathan Mini said words to the effect of;
> > 
> > > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11120
> > > 
> > > Change 11120 by mini@mini_stylus on 2002/05/10 08:30:36
> > > 
> > > 	Give UMA control over thread allocation and caching:
> > > 	
> > > 	  [ ... ]
> > 
> > I'm not sure that using the uma callouts for all of this is safe.
> 
> What specifically do you think is dangerous?

Sleeping with a mutex held.

> 
> > > +	mtx_lock_spin(&sched_lock);
> > > +
> > > +	mtx_unlock_spin(&sched_lock);
> > 
> > ???
> 
> *rofl* I can't believe that. Already fixed. Dunce cap for me. ;)
> 
> > > +	td = (struct thread *)mem;
> > > +	pmap_dispose_thread(td);
> > > +	vm_object_deallocate(td->td_kstack_obj);
> > > +	cached_threads--;	/* XXXSMP */
> > > +	allocated_threads--;	/* XXXSMP */
> > > +}
> > 
> > These pmap and vm_object calls might sleep, and are called with the uma
> > zone locked.
> > 
> 
> Hmm, that's not good.
> 
> > Almost all of the new code you added looks like its indented 4 spaces,
> > which should be tabs  :)
> 
> >From style(9):
> 
>      Indentation is an 8 character tab.  Second level indents are four spaces.
> 
> .. I must have misread that. What are second level indents, then?

Second level indent is for wrapping lines that spill over 78 columns.

ie (contrived examples that don't actually wrap):

	if (foo &&
	    bar) {
	^^^^  <-- this is second level
		baz();
	}

	or

	x = y +
	    z;
	^^^ <-- and so is this

but:

	if (foo)
		bar();
	^^^^  <-- this is not


Hope this helps.

> 
> 
> -- 
> Jonathan Mini <mini@freebsd.org>
> http://www.haikugeek.com
> 
> "He who is not aware of his ignorance will be only misled by his knowledge."
>                                                         -- Richard Whatley

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




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