From owner-freebsd-current Wed Oct 9 15:56:10 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 9E78537B401; Wed, 9 Oct 2002 15:56:08 -0700 (PDT) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id E3B8C43E42; Wed, 9 Oct 2002 15:56:07 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: by frog.fafoe (Postfix, from userid 1001) id 722BB2A9; Thu, 10 Oct 2002 00:56:06 +0200 (CEST) Date: Thu, 10 Oct 2002 00:56:06 +0200 From: Stefan Farfeleder To: Don Lewis Cc: tlambert2@mindspring.com, jhb@FreeBSD.ORG, jmallett@FreeBSD.ORG, current@FreeBSD.ORG, phk@FreeBSD.ORG Subject: Re: [PATCH] Re: Junior Kernel Hacker page updated... Message-ID: <20021009225606.GC306@frog.fafoe> References: <20021008204605.GA252@frog.fafoe> <200210090426.g994QTvU037393@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210090426.g994QTvU037393@gw.catspoiler.org> User-Agent: Mutt/1.5.1i 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 On Tue, Oct 08, 2002 at 09:26:29PM -0700, Don Lewis wrote: > On 8 Oct, Stefan Farfeleder wrote: > > On Mon, Oct 07, 2002 at 03:48:45AM -0700, Terry Lambert wrote: > > > Following the advice from the spl* man page I turned the spl* calls to a > > mutex and was surprised to see it working. My SMP -current survived a 'make > > -j16 buildworld' with make using kqueue() (which it did not a single > > time out of >30 times before). Further testings will follow tomorrow. Building 6 worlds in a row with -j ranging from 4 to 128 didn't crash it. > > However, WITNESS complains (only once) about this: > > lock order reversal > > 1st 0xc662140c kqueue mutex (kqueue mutex) @ /freebsd/current/src/sys/kern/kern_event.c:714 > > 2nd 0xc6727d00 pipe mutex (pipe mutex) @ /freebsd/current/src/sys/kern/sys_pipe.c:1478 > > That's pretty similar to the lock order reversal I've seen in the pipe > code and it's interaction with sigio, which is not suprising since > pipeselwakeup() calls both pgsigio() and KNOTE(), often while the pipe > lock is held. Correctly fixing this doesn't look easy ... 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? @Poul: Since you are the only person who reported a kernel crash too, does the version with the mutex work for you? Regards, Stefan Farfelder To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message