Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Jun 2002 16:47:14 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        freebsd-hackers@FreeBSD.ORG, Julian Elischer <julian@elischer.org>, Alan Cox <alc@cs.rice.edu>, Tor.Egge@cvsup.no.freebsd.org
Subject:   Re: Bug in wakeup() (stable and current) ?
Message-ID:  <20020623234714.GN53232@elvis.mu.org>
In-Reply-To: <200206232032.g5NKWVZW063483@apollo.backplane.com>
References:  <200206232014.g5NKE5x3058562@apollo.backplane.com> <20020623201933.GM53232@elvis.mu.org> <200206232032.g5NKWVZW063483@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Matthew Dillon <dillon@apollo.backplane.com> [020623 13:32] wrote:
> :I'm pretty sure you only need to 'goto restart' if you call into
> :maybe_resched() as someone else may have manipulated the queues.
> :
> :The 'restart' label is only in there for restarting in case one of
> :the functions called may change the lists, if we restart _every_
> :time we'll traverse the same procs where p->p_wchan != ident over
> :and over needlessly.
> :
> :-Alfred
> 
>     Look at the code carefully.  It's *removing* the element from the list,
>     the conditionally restarting rather then removing the element from the
------^^^ then??
>     list and unconditionally restarting.  The only reason it works at all
>     is because sys/queue.h does not clear out the pointers in the node 
>     that was just removed.  The code is just plain wrong, though, because
>     the queue mechanisms make no such (documented) guarentee.

You're right, but other than await() why would a process find itself
on a sleep queue if not in SSLEEP?

-- 
-Alfred Perlstein [alfred@freebsd.org]
'Instead of asking why a piece of software is using "1970s technology,"
 start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/

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




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