Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: "T. Srikanth" <sthrovag@cisco.com>
Subject: Re: Why Restart in Wakeup?
Date: 1998/05/29	[thread overview]
Message-ID: <356EEA18.DCA42C85@cisco.com> (raw)
In-Reply-To: 6km98m$2sc$1@gte1.gte.net


> >         I'd be more inclined to ask why bother with the 'else continue'
> >         on lines 14 and 15. Looks redundant to me.
> >
> > -am
>
> Indeed, my kernel (FreeBSD) does not have the else, continue clause.  As
> to the original question, sleeping processes are put on one of several
> linked lists (depending on wchan).  If the process is swapped, wakeup is
> called recursively to wake up process 0 (the swapper). This has the
> potential to invalidate the ``next process on list'' pointer of the
> sleeping process, so the scan of the list is begun again at the
> beginning.
>
> Jon Snader

This sure is the hint! Swapper sleeps on the address of its proc table structure. There cannot
possibly be many other processes on this private event identifier referred to as &proc0 in NetBSD.
Since the kernel may maintain hashed lists of the processes in sleep, wakeup of the kernel process
swapper can lead to modification of forward and backward pointers in the sleep queue. Since
wakeup means "putting the process back on the run list", this could be expensive and does
not guarantee the woken-up processes will really run. They may again be put back to sleep
on "the survival of the luckiest process" basis.

- srikanth





           reply	other threads:[~1998-05-29  4:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <6km98m$2sc$1@gte1.gte.net>]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox