Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Dec 2001 00:46:40 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Luigi Rizzo <rizzo@aciri.org>, Peter Wemm <peter@wemm.org>, <current@FreeBSD.ORG>
Subject:   Re: vm_zeropage priority problems.
Message-ID:  <20011222003639.B4708-100000@gamplex.bde.org>
In-Reply-To: <XFMail.011220124111.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 20 Dec 2001, John Baldwin wrote:

> On 20-Dec-01 Luigi Rizzo wrote:
> > On Thu, Dec 20, 2001 at 12:16:03PM -0800, John Baldwin wrote:
> >> However, kthreads should tsleep() with their current priority, not PPAUSE.
> >
> > "current" meaning pri_level or pri_native ? What if one tries to
> > tsleep() while holding a lock and so its pri_level is raised ?
>
> pri_level.  Calling tsleep() while holding a lock is a bug though. :)  Unless
> you are calling msleep() with a lock that will be released.
>
> > In the device polling code i did a tsleep on the "original" pri_level,
> > but maybe pri_native is good enough.
>
> pri_level is more correct.

I think pri_native is just an implementation detail which shouldn't
be used or visible to threads.  It used used by the priority propagation
mechanism to hold the original pri_level.  Threads should just use their
original priority (or a different one if they want to temporarily change
thier priority).  Even pri_level probably shouldn't be used or visible
to threads.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011222003639.B4708-100000>