Date: Mon, 16 Jul 2007 07:41:41 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Roman Divacky <rdivacky@freebsd.org> Subject: Re: [PATCH]: acct_process() locking and exit1() Message-ID: <200707160741.44094.jhb@freebsd.org> In-Reply-To: <20070614075830.GA71887@freebsd.org> References: <20070614075439.GA71601@freebsd.org> <20070614075830.GA71887@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 14 June 2007 03:58:30 am Roman Divacky wrote: > On Thu, Jun 14, 2007 at 09:54:39AM +0200, Roman Divacky wrote: > > hi > > > > currently in exit1() we call acct_process() with Giant held. > > I looked at the code and I think this is because of tty need > > for Giant locking. Because of this we have to release process limit > > in a separate PROC_LOCK()/UNLOCK() block. > > > > my just-to-look-at patch does this > > > > 1) moves the acct_process() in exit1() out of Giant locked block (upward) > > 2) acquires Giant in the acct_process() around tty handling > > 3) moves the p->p_limit to a different PROC_LOCK/UNLOCK block (upward) > > > > the result is saving 2 proc mtx operations in exit1() > > > > can you look at it and tell me if its correct or wrong or something like that? > > > > if it's correct is it worth committing? saving two mtx operations is a nice thing :) > > erm... two bugs ;) "saving two mtx operations..." in the typical case of accounting > NOT being enabled. > > and forgot to show the patch ;) it's here > > www.vlakno.cz/~rdivacky/kern_acct.patch 1) It would be nicer if lim_free() wasn't so far away from the rest of the limit freeing code (including the comment). Also, missing a blank line before the comment now. 2) acct_process() saves resource usage information, so the later it is in exit1() the more accurate it is going to be, so it's probably best to leave it as it is unless you observe a measurable change in a benchmark with this patch. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707160741.44094.jhb>