From owner-freebsd-hackers Sun Jun 23 18:40:28 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from sccrmhc02.attbi.com (sccrmhc02.attbi.com [204.127.202.62]) by hub.freebsd.org (Postfix) with ESMTP id B7BD637B401 for ; Sun, 23 Jun 2002 18:40:13 -0700 (PDT) Received: from InterJet.elischer.org ([12.232.206.8]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020624014012.SLZV1547.sccrmhc02.attbi.com@InterJet.elischer.org>; Mon, 24 Jun 2002 01:40:12 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id SAA49411; Sun, 23 Jun 2002 18:39:57 -0700 (PDT) Date: Sun, 23 Jun 2002 18:39:55 -0700 (PDT) From: Julian Elischer To: Matthew Dillon Cc: Alfred Perlstein , freebsd-hackers@FreeBSD.ORG, Alan Cox , Tor.Egge@cvsup.no.freebsd.org Subject: Re: Bug in wakeup() (stable and current) ? In-Reply-To: <200206232032.g5NKWVZW063483@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 23 Jun 2002, Matthew Dillon 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 > 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. ummmm Was this found because of my tailq debugging stuff that sets the forward pointer to -1? > > -Matt > Matthew Dillon > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message