From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 12 12:28:54 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37EA816A400 for ; Sun, 12 Mar 2006 12:28:53 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78B7D43D48 for ; Sun, 12 Mar 2006 12:28:52 +0000 (GMT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id k2CCSnTl054790; Sun, 12 Mar 2006 13:28:50 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id k2CCSkEl096441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Mar 2006 13:28:46 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id k2CCSjKs021526; Sun, 12 Mar 2006 13:28:45 +0100 (CET) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id k2CCSj27021525; Sun, 12 Mar 2006 13:28:45 +0100 (CET) (envelope-from ticso) Date: Sun, 12 Mar 2006 13:28:45 +0100 From: Bernd Walter To: Pranav Peshwe Message-ID: <20060312122844.GL14157@cicely12.cicely.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 X-Spam-Report: * -3.3 ALL_TRUSTED Did not pass through any untrusted hosts * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on cicely12.cicely.de Cc: freebsd-hackers@freebsd.org Subject: Re: Doubts about PICKUP_GIANT() and mtx_lock(&Giant). X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Mar 2006 12:28:54 -0000 On Sun, Mar 12, 2006 at 04:25:07PM +0530, Pranav Peshwe wrote: > Hello, > What is effectively the difference between PICKUP/DROP_GIANT and > mtx_lock/unlock(&Giant) ? From the macro expansion, i surmise that > PICKUP/DROP_GIANT deals with recursion in Giant locking.Is this correct ? is > this the only difference ? What will happen if i mix the usage of > PICKUP/DROP_GIANT and mtx_lock/unlock(&Giant) ? You can't mix them, because they are used in different situtation. You call DROP_GIANT and later PICKUP to handle situations where it is required to drop GIANT for a while. You call mtx_lock and later unlock to hold GIANT for a while. -- B.Walter http://www.bwct.de http://www.fizon.de bernd@bwct.de info@bwct.de support@fizon.de