From owner-freebsd-hackers@FreeBSD.ORG Thu May 8 20:33: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 3049F106566B for ; Thu, 8 May 2008 20:33:22 +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 11D558FC15 for ; Thu, 8 May 2008 20:33:21 +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; 08 May 2008 13:31:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.27,456,1204531200"; d="scan'208,217";a="562415524" Received: from orsmsx335.amr.corp.intel.com (HELO orsmsx335.jf.intel.com) ([10.22.226.40]) by fmsmga001.fm.intel.com with ESMTP; 08 May 2008 13:34:09 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 8 May 2008 13:33:21 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Thu, 8 May 2008 13:33:20 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: SW_PREEMPT and cpu runq Thread-Index: AcixSsFIu3sSWsbiTX+53zD0DO1PEg== From: "Murty, Ravi" To: X-OriginalArrivalTime: 08 May 2008 20:33:21.0280 (UTC) FILETIME=[C189F800:01C8B14A] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: SW_PREEMPT and cpu 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: Thu, 08 May 2008 20:33:22 -0000 Hi, =20 When a thread is being switched out and it is being preempted (e.g. time quantum expires), why does sched_switch hold it on the current cpu? i.e. why does the code see that it was preempted and put it back on the same queue? In other cases it looks to see if it can be migrated and the thread goes back some place else. If a thread is being kicked out and there is a perfectly idle CPU some where on the system, wouldn't it make sense to migrate the thread? =20 Thanks Ravi =20