Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Sep 2002 21:05:45 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        smp@FreeBSD.ORG
Subject:   Re: wakeup handling on SMP boxes
Message-ID:  <20020912204245.I5891-100000@gamplex.bde.org>
In-Reply-To: <20020911172143.H93521@iguana.icir.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 11 Sep 2002, Luigi Rizzo wrote:

> On Thu, Sep 12, 2002 at 05:18:34AM +1000, Bruce Evans wrote:
> ...
> > > This seems to suggest that the priority ordering might be violated
> > > for as much as kern.quantum, after which the roundrobin() and
> > > forward_roundrobin() will do the right thing.
> >
> > Only if the process stays in the kernel that long.  The quantum is not
> ...
> > Processes are supposed to sleep at a high (or suitable) priority so that
>
> now, this is another debatable thing -- why do processes sleep at
> high priority at all given that they are not holding any locks while
> sleeping ?

So that they get run soon after they wake up.  The priority doesn't matter
while they are asleep, but the system needs to know what priority to use
when it wakes them.

> > I think it would be too expensive to switch contexts on every significant
> > priority change even under !SMP.
>
> but isn't that what actually happens already most of the times ?
> The woken up process has a higher priority than userland processes so
> it always causes a reschedule when the CPU returns to a user context ?

You are probably right for the !kernel-bound case.  I was thinking of
immediate context switches in the kernel.

> The additional cost under SMP would be the Xcpuast IPI -- how expensive
> it is on both the sender and the receiver i have no idea though, does it
> require the sender to spin until the receiver has cleared the flag ?

I think Xcpuast is relatively inexpensive.  It doesn't require a rendevous.

Bruce


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




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