From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 16 22:02:38 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 60B4D106566C for ; Wed, 16 Apr 2008 22:02:38 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx1.freebsd.org (Postfix) with ESMTP id 379F78FC16 for ; Wed, 16 Apr 2008 22:02:38 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Apr 2008 14:32:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,666,1199692800"; d="scan'208,217";a="271274528" Received: from orsmsx335.amr.corp.intel.com (HELO orsmsx335.jf.intel.com) ([10.22.226.40]) by orsmga002.jf.intel.com with ESMTP; 16 Apr 2008 14:33:26 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 16 Apr 2008 14:33:28 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Wed, 16 Apr 2008 14:33:27 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: md_spinlock_count? Thread-Index: AcigCYHX55FKH/ilSyKoSaQWgpt/wg== From: "Murty, Ravi" To: X-OriginalArrivalTime: 16 Apr 2008 21:33:28.0879 (UTC) FILETIME=[82BF63F0:01C8A009] X-Mailman-Approved-At: Wed, 16 Apr 2008 23:08:58 +0000 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:02:38 -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. 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 Thanks Ravi Murty