From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 10 17:58:09 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 7C76F1065700 for ; Mon, 10 Nov 2008 17:58:09 +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 483828FC20 for ; Mon, 10 Nov 2008 17:58:08 +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; 10 Nov 2008 09:52:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,577,1220252400"; d="scan'208,217";a="358331595" Received: from unknown (HELO azsmsx001.amr.corp.intel.com) ([10.2.167.98]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2008 09:57:10 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.226.87) by azsmsx001.amr.corp.intel.com (10.2.167.98) with Microsoft SMTP Server (TLS) id 8.1.311.2; Mon, 10 Nov 2008 10:57:54 -0700 Received: from orsmsx506.amr.corp.intel.com ([10.22.226.44]) by orsmsx604.amr.corp.intel.com ([10.250.113.17]) with mapi; Mon, 10 Nov 2008 09:57:46 -0800 From: "Murty, Ravi" To: "freebsd-hackers@freebsd.org" Date: Mon, 10 Nov 2008 09:57:44 -0800 Thread-Topic: Typo in ULE in FreeBSD 8.0 -- that's not really a bug Thread-Index: AclDXdVfLGr+0BvBRDiTEBd0fV2vKg== Message-ID: <6D5D25EA3941074EB7734E51B16687040AD02A77@orsmsx506.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Typo in ULE in FreeBSD 8.0 -- that's not really a bug 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, 10 Nov 2008 17:58:09 -0000 Hello All, I have been playing with ULE in 8.0 and while staring at tdq_notify noticed= an interesting (and what seems like a typo) problem. The intention of the function is obvious, send an IPI to notify the remote = CPU of some new piece of work. In the case where there is no IPI currently = pending on the target CPU and this thread should be preempting what's runni= ng there, the code checks in td (passed in as a parameter) is the IDLE thre= ad (TDF_IDLETD). If so, it checks the state and sees if idle is RUNNING and= if so figures it will notice this new work and we don't really need to sen= d an expensive IPI. However, why would td (parameter) ever be the IDLE thre= ad? It almost seems like this check will always fail and we end up sending = a hard IPI to the target CPU which works, but may not be needed. May be we = wanted to use PCPU->curthread instead of td? Thanks Ravi