From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 16 22:32:22 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 9CE191065673 for ; Wed, 16 Apr 2008 22:32:22 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx1.freebsd.org (Postfix) with ESMTP id 6A2E18FC24 for ; Wed, 16 Apr 2008 22:32:22 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 16 Apr 2008 15:31:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,666,1199692800"; d="scan'208,217";a="271297372" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by orsmga002.jf.intel.com with ESMTP; 16 Apr 2008 15:32:19 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 16 Apr 2008 15:32:21 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Wed, 16 Apr 2008 15:32:20 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: md_spinlock_count? Thread-Index: AcigEbwGeWcf+4KGRVqcV42pRHFz4Q== From: "Murty, Ravi" To: X-OriginalArrivalTime: 16 Apr 2008 22:32:21.0835 (UTC) FILETIME=[BC8DB1B0:01C8A011] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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: Wed, 16 Apr 2008 22:32:22 -0000 Hello All, =20 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. =20 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.=20 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?=20 =20 Thanks Ravi Murty =20