Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Re: Why Restart in Wakeup?
       [not found]   ` <6km98m$2sc$1@gte1.gte.net>
@ 1998-05-29  4:00     ` T. Srikanth
  0 siblings, 0 replies; only message in thread
From: T. Srikanth @ 1998-05-29  4:00 UTC (permalink / raw)



> >         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





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1998-05-29  4:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <356DABF9.91A235BD@cisco.com>
     [not found] ` <6kkvl7$1rh$1@reader1.reader.news.ozemail.net>
     [not found]   ` <6km98m$2sc$1@gte1.gte.net>
1998-05-29  4:00     ` Why Restart in Wakeup? T. Srikanth

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