Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Nov 2000 12:07:54 -0800
From:      Jake Burkholder <jburkhol@home.com>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Alfred Perlstein <bright@wintelcom.net>, smp@FreeBSD.ORG
Subject:   Re: uidinfo patches, review please. 
Message-ID:  <20001125200754.CC0B8BA7A@io.yi.org>
In-Reply-To: Message from John Baldwin <jhb@FreeBSD.ORG>  of "Sat, 25 Nov 2000 11:27:51 PST." <XFMail.001125112751.jhb@FreeBSD.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> On 25-Nov-00 Alfred Perlstein wrote:
> > Protect the uidinfo structures.
> > 
> > My only concern is that I must now include sys/mutex.h in
> > sys/resourcevar.h, I didn't notice any userland utils using
> > this file, I'm going to try to do a buildworld.
> > 
> > A kernel with this patch boots and seems to run multiuser
> > fine.

Looks ok to me.

> 
> I'll try and test this on Monday.  Have you compiled a kernel with WITNESS
> turned on?  You probably want to add an explicit lock order of:
> 
> "uidinfo hash", "uidinfo struct", NULL
> 
> to the order_list in the witness code to make sure those locks aren't gotten
> out of order as well.  Looks ok to me though for the most part (see comments

Kernel boots with WITNESS enabled, I also added this to the order list;
make buildworld is chugging away on my SMP box.

> > @@ -735,9 +744,13 @@
> >                       printf("freeing uidinfo: uid = %d, proccnt = %ld\n",
> >                           uip->ui_uid, uip->ui_proccnt);
> >               LIST_REMOVE(uip, ui_hash);
> > +             mtx_destroy(&uip->ui_mtx);
> > +             mtx_exit(&uidhash_mtx, MTX_DEF);
> 
> You should mtx_exit(&uip->ui_mtx) before destroying it here.

This isn't strictly necessary, mtx_destroy handles destroying a
held mutex.  I suppose it saves a locked bus op.



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




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