From owner-cvs-src@FreeBSD.ORG Thu Oct 16 09:45:37 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2C6516A4B3 for ; Thu, 16 Oct 2003 09:45:37 -0700 (PDT) Received: from mail.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id D506643F75 for ; Thu, 16 Oct 2003 09:45:31 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 25731 invoked from network); 16 Oct 2003 16:45:30 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 16 Oct 2003 16:45:30 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h9GGjGce059838; Thu, 16 Oct 2003 12:45:17 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20031014225540.N30029-100000@mail.chesapeake.net> Date: Thu, 16 Oct 2003 12:45:26 -0400 (EDT) From: John Baldwin To: Jeff Roberson X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: cvs-src@FreeBSD.org cc: Jeff Roberson cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: RE: cvs commit: src/sys/sys mutex.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2003 16:45:37 -0000 On 15-Oct-2003 Jeff Roberson wrote: > On Tue, 14 Oct 2003, John Baldwin wrote: >> On 14-Oct-2003 Jeff Roberson wrote: >> > I know it is racy in most contexts. I use it to check to see if a thread >> > on the runq owns giant. Since I have the sched lock it isn't racy but >> > even if it was it wouldn't matter in this case. >> >> sched lock doesn't keep it from being racy. Uncontested acquire and >> releases don't go anywhere near sched lock. Are you checking a >> non-curthread thread pointer? Maybe you could just do it for curthread >> and that would be enough for your heuristic, i.e. > > Yes it does. I'm checking a thread that is on the run queue but not > running. If it holds giant it will hold giant until I drop the sched lock > and schedule it to run. Ah, ok. >> >> if (thread == curthread && mtx_owned(&Giant)) { >> ... >> } >> >> I'm just worried that if this is there someone is going to use it. :( > > Yes, I see, this is a valid concern. I originally had it in sched_ule.c > only but decided that it was ugly to do so. I could move it back or > manually code the check there. I would prefer that then. This is really only a "temporary" heuristic while Giant exists anyways. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/