From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 23 18:21:57 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 757071065675 for ; Thu, 23 Oct 2008 18:21:57 +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 281608FC16 for ; Thu, 23 Oct 2008 18:21:56 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 23 Oct 2008 11:16:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.33,471,1220252400"; d="scan'208,217";a="395328117" Received: from azsmsx602.amr.corp.intel.com ([10.2.121.201]) by fmsmga002.fm.intel.com with ESMTP; 23 Oct 2008 11:18:16 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.226.211) by azsmsx602.amr.corp.intel.com (10.2.121.201) with Microsoft SMTP Server (TLS) id 8.1.311.2; Thu, 23 Oct 2008 11:21:56 -0700 Received: from orsmsx506.amr.corp.intel.com ([10.22.226.44]) by orsmsx602.amr.corp.intel.com ([10.22.226.211]) with mapi; Thu, 23 Oct 2008 11:21:52 -0700 From: "Murty, Ravi" To: "freebsd-hackers@freebsd.org" Date: Thu, 23 Oct 2008 11:21:49 -0700 Thread-Topic: sched_thread_priority in ULE 8.0 Thread-Index: Ack1PDdG8OBeEr2cQUqIbVyUy7bM2w== Message-ID: <6D5D25EA3941074EB7734E51B166870401DDFA1D@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: sched_thread_priority in ULE 8.0 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, 23 Oct 2008 18:21:57 -0000 Hello All, This is something I've been trying to figure out in the last couple of hour= s, but can't seem to understand. Sched_thread_priority() updates a threads priority to "prio". If the thread= is on the RUNQ, we have to pull it out and put it back at a different spot= on the same queue. However, if the thread is currently running, I am missi= ng something. If it is running shouldn't tdq->tdq_lowpri basically be same = as the threads current priority (aka oldpri).. I can't seem to figure out w= hy we need the else if check and a call to tdq_lowpri. If the thread is run= ning and we've boosted the thread's priority, then simply changing tdq_lowp= ri should do it right? I've included part of the sched_thread_priority code below. Thanks Ravi The code is as follows: ... If (prio < tdq->tdq_lowpri) tdq->tdq_lowpri else if (tdq->tdq_lowpri =3D=3D oldpri) tdq_setlowpri(tdq, td);