From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 14 07:54:44 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 2DA9816A41F for ; Thu, 14 Jun 2007 07:54:44 +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 E15F213C447 for ; Thu, 14 Jun 2007 07:54:43 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id EEB998BE229 for ; Thu, 14 Jun 2007 09:54:41 +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 PcC6RrwvrsY0 for ; Thu, 14 Jun 2007 09:54:40 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A80B58BDBE9 for ; Thu, 14 Jun 2007 09:54:40 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.13.8/8.13.8/Submit) id l5E7se9l071785 for hackers@freebsd.org; Thu, 14 Jun 2007 09:54:40 +0200 (CEST) (envelope-from rdivacky) Date: Thu, 14 Jun 2007 09:54:39 +0200 From: Roman Divacky To: hackers@freebsd.org Message-ID: <20070614075439.GA71601@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: [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:54:44 -0000 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 :) thank you roman