From owner-freebsd-current Wed Oct 9 16: 9:22 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7079A37B401; Wed, 9 Oct 2002 16:09:21 -0700 (PDT) Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CC8443E42; Wed, 9 Oct 2002 16:09:21 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0210.cvx21-bradley.dialup.earthlink.net ([209.179.192.210] helo=mindspring.com) by swan.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17zPww-0002zO-00; Wed, 09 Oct 2002 16:09:06 -0700 Message-ID: <3DA4B6C1.ED1BACEB@mindspring.com> Date: Wed, 09 Oct 2002 16:07:45 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Stefan Farfeleder Cc: Don Lewis , jhb@FreeBSD.ORG, jmallett@FreeBSD.ORG, current@FreeBSD.ORG, phk@FreeBSD.ORG Subject: Re: [PATCH] Re: Junior Kernel Hacker page updated... References: <20021008204605.GA252@frog.fafoe> <200210090426.g994QTvU037393@gw.catspoiler.org> <20021009225606.GC306@frog.fafoe> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Stefan Farfeleder wrote: > Is it just a warning or does it pose a real problem? > > I think the problem with the current code is that knote_{en,de}queue can > be executed in parallel (on another CPU, spl*() can't prevent that, can > it?) with kqueue_scan and that kq->kq_head thus can be corrupted. > Or am I totally wrong? My patch would have worked, in that case, since it would ensure one marker entry with a unique stack address per simultaneous scanner. It has to be that the queue itself is being deleted out from under it: the problem is not the scan, nor the insert or the delete. Most likely, this is for an object whose queue is not tracked by process, or for a process queue that's being examined by another process (e.g. kevent's on fork/exit/etc.). You can verify this for your own satisfaction by looking at the pointer manipulation order for the insertion and deletion; the insertion sets the next pointer before setting the pointer to the inserted object, and the deletion sets the pointer that used to point to the deleted object to the delete object's next, before deleting the object. Thus, traversals in progress should not result in an error. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message