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

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

On 25-Nov-00 Jake Burkholder wrote:
>> 
>> 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.

Cool.

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

Well, I'd rather have it for correctness' sake.

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


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?XFMail.001125123216.jhb>