From owner-freebsd-threads@FreeBSD.ORG Thu Sep 30 09:50:04 2010 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 180491065673 for ; Thu, 30 Sep 2010 09:50:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 07C2F8FC08 for ; Thu, 30 Sep 2010 09:50:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8U9o3YD052761 for ; Thu, 30 Sep 2010 09:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8U9o33F052760; Thu, 30 Sep 2010 09:50:03 GMT (envelope-from gnats) Date: Thu, 30 Sep 2010 09:50:03 GMT Message-Id: <201009300950.o8U9o33F052760@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/141721: rtprio(1): (id|rt)prio priority resets when new thread is created X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2010 09:50:04 -0000 The following reply was made to PR threads/141721; it has been noted by GNATS. From: David Xu To: bug-followup@freebsd.org, c.kworr@gmail.com Cc: Subject: Re: threads/141721: rtprio(1): (id|rt)prio priority resets when new thread is created Date: Thu, 30 Sep 2010 17:48:05 +0000 idle priority is not supported by libthr yet, the reason I don't want to enable it is kernel also may have trouble to handle idle thread. a thread in kernel holds a non-mutex lock and is preempted, it is possible to be starved by other threads, such a priority reversal can make system work rather badly. I think the thread preemption may should work in opposite direction. default, it should always be disabled in kernel, only some code knows where it is OK to be preempted: 1. interrupt thread preempt others 2. a thread returned to userland 3. some kernel code, it knows it is doing large computation, or non-sense code, it turns on preemption, when it exits such code, it turns off preemption. idle thread does not mean it is not execute important code, idle thread can execute any code in kernel, so idle does not mean it is insignificant, the word 'idle' is bogus, priority does not mean it is important or less important.