From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 17 00:12:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF211065672 for ; Thu, 17 Apr 2008 00:12:04 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outw.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 06D6E8FC16 for ; Thu, 17 Apr 2008 00:12:03 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 17 Apr 2008 04:15:53 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 79A6A2D6004; Wed, 16 Apr 2008 17:12:03 -0700 (PDT) Message-ID: <480695D7.5050600@elischer.org> Date: Wed, 16 Apr 2008 17:12:07 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: md_spinlock_count? 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, 17 Apr 2008 00:12:04 -0000 Murty, Ravi wrote: > Hello All, > > > > I was looking at the code that creates a new process (fork) with a > single thread coming out on the other side. I can't figure out a couple > of things. > > > > 1. Why is the md_spinlock_count for the new thread set to 1 and not > to 0. This happens in cpu_fork and cpu_set_upcall under the amd64 tree. > 2. If this was the "per-cpu" idle thread and the AP was booting up > (running init_secondary) why does it grab sched_lock and call > spinlock_exit. It would seem simpler to set the count of the idle thread > to 0 and not have to call spinlock_exit. The only answer I can come up > with is the fact that a non-zero spinlock_count prevents interrupts from > getting disabled/renabled to some unknown value? Which version/branch? (and a filename and linenumber would be good too) You might make it easy for us to answer you :-) > > > > Thanks > > Ravi Murty > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"