From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 16 18:17:41 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 15DA1106564A for ; Mon, 16 Jun 2008 18:17:41 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx1.freebsd.org (Postfix) with ESMTP id D4AC98FC1E for ; Mon, 16 Jun 2008 18:17:40 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 16 Jun 2008 10:46:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.27,653,1204531200"; d="scan'208,217";a="578483962" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by fmsmga001.fm.intel.com with ESMTP; 16 Jun 2008 10:50:47 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 16 Jun 2008 10:49:28 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Mon, 16 Jun 2008 10:49:26 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: TD_ON_RUNQ() Thread-Index: AcjP2VGUNQabns4lR+Ku0NfrJSDvPQ== From: "Murty, Ravi" To: X-OriginalArrivalTime: 16 Jun 2008 17:49:28.0939 (UTC) FILETIME=[531E0BB0:01C8CFD9] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: TD_ON_RUNQ() 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: Mon, 16 Jun 2008 18:17:41 -0000 Hello Everybody, =20 This is a basic question - I've noticed this code in the kernel and sched_4bsd.c which basically says assert that I am running on that I am not on the runq. For instance, in mi_switch() (kern_sync.c) there is an assert KASSERT(!TD_ON_RUNQ(td), ("mi_switch: called by old code")). I guess if mi_switch is being called for curthread, it must be running which means it can't be on the runq, but I don't understand the assert string. Similarly in sched_4bsd.c in function sched_bind, the assertion says "assert that this thread is running" - and I've seen this assert happen. =20 Thanks Ravi =20