From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 14 07:58:32 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6403E16A468 for ; Thu, 14 Jun 2007 07:58:32 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 20BBF13C455 for ; Thu, 14 Jun 2007 07:58:32 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 478EC8BE22B for ; Thu, 14 Jun 2007 09:58:31 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aAWHtJ1C+FBO for ; Thu, 14 Jun 2007 09:58:30 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 558FB8BE22E for ; Thu, 14 Jun 2007 09:58:30 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l5E7wUFX071984 for hackers@freebsd.org; Thu, 14 Jun 2007 09:58:30 +0200 (CEST) (envelope-from rdivacky) Date: Thu, 14 Jun 2007 09:58:30 +0200 From: Roman Divacky To: hackers@freebsd.org Message-ID: <20070614075830.GA71887@freebsd.org> References: <20070614075439.GA71601@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070614075439.GA71601@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: [PATCH]: acct_process() locking and exit1() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2007 07:58:32 -0000 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