From owner-freebsd-current@FreeBSD.ORG Wed Dec 21 16:19:40 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B10B216A41F for ; Wed, 21 Dec 2005 16:19:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9019143D64 for ; Wed, 21 Dec 2005 16:19:28 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4296156 for multiple; Wed, 21 Dec 2005 11:21:00 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBLGJJDR016736; Wed, 21 Dec 2005 11:19:21 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Joseph Koshy Date: Wed, 21 Dec 2005 11:19:53 -0500 User-Agent: KMail/1.8.2 References: <20051220032538.A33093@xorpc.icir.org> <200512201422.47323.jhb@freebsd.org> <84dead720512201904q6dbe5e6er6925282d4d320bee@mail.gmail.com> In-Reply-To: <84dead720512201904q6dbe5e6er6925282d4d320bee@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512211119.54940.jhb@freebsd.org> X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Luigi Rizzo , freebsd-current@freebsd.org Subject: Re: td->td_critnest manipulations do not use atomic_add_int ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Dec 2005 16:19:40 -0000 On Tuesday 20 December 2005 10:04 pm, Joseph Koshy wrote: > lr> is td ever != curthread? > > jhb> No. > > I don't think we KASSERT() this in enough places in the code > though. void critical_enter(void) { struct thread *td; td = curthread; td->td_critnest++; CTR4(KTR_CRITICAL, "critical_enter by thread %p (%ld, %s) to %d", td, (long)td->td_proc->p_pid, td->td_proc->p_comm, td->td_critnest); } void critical_exit(void) { struct thread *td; td = curthread; KASSERT(td->td_critnest != 0, .. } Need I say more? Clearly td == curthread. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org