From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 3 16:26: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 D2488106564A for ; Thu, 3 Jul 2008 16:26:04 +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 95E3E8FC14 for ; Thu, 3 Jul 2008 16:26:04 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 03 Jul 2008 01:22:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.27,742,1204531200"; d="scan'208,217";a="404935543" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by orsmga001.jf.intel.com with ESMTP; 03 Jul 2008 09:25:44 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 3 Jul 2008 09:26:03 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 3 Jul 2008 09:26:02 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: calcru question Thread-Index: AcjdKXwgf+vwDxACRae/0MQwJmIJGQ== From: "Murty, Ravi" To: X-OriginalArrivalTime: 03 Jul 2008 16:26:03.0306 (UTC) FILETIME=[7C8CD0A0:01C8DD29] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: calcru question 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, 03 Jul 2008 16:26:05 -0000 Hello All, =20 I have a rather simple question. I am running the 6.2 kernel and calru is called when top is run in a loop. One of the things calcru does is walk to threads of a process and checks if the thread is running and if it asserts that its tdoncpu field be anything but NOCPU. In our case, one in a great while, this assertion fails and the kernel panics. The assertion makes perfect sense, but I can't seem to figure out how this can be happening. The td->td_oncpu field is set to NOCPU when the thread is being kicked off a CPU (sched_switc()) which means it is not running and all of this happens with sched_lock held which calcru also grabs. =20 Thanks, Ravi =20