From owner-freebsd-hackers@FreeBSD.ORG Wed May 23 02:23:34 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D62F716A400 for ; Wed, 23 May 2007 02:23:34 +0000 (UTC) (envelope-from lstewart@room52.net) Received: from swin.edu.au (gpo1.cc.swin.edu.au [136.186.1.221]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF2213C465 for ; Wed, 23 May 2007 02:23:34 +0000 (UTC) (envelope-from lstewart@room52.net) Received: from [136.186.229.95] (lstewart.caia.swin.edu.au [136.186.229.95]) by swin.edu.au (8.13.6.20060614/8.13.1) with ESMTP id l4N2NSxT017628; Wed, 23 May 2007 12:23:28 +1000 Message-ID: <4653A5D2.4070209@room52.net> Date: Wed, 23 May 2007 12:24:18 +1000 From: Lawrence Stewart User-Agent: Thunderbird 1.5.0.9 (X11/20070123) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <4649349D.4060101@room52.net> <200705150847.38838.marc.loerner@hob.de> <46499491.2010205@room52.net> <46515DE0.20209@room52.net> <86sl9qtpd1.fsf@dwp.des.no> <4652AD8C.7000605@room52.net> <86r6p9md2n.fsf@dwp.des.no> <465397FB.9080309@room52.net> In-Reply-To: <465397FB.9080309@room52.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED autolearn=disabled version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on gpo1.cc.swin.edu.au Cc: freebsd-hackers@freebsd.org Subject: Re: Writing a plain text file to disk from kernel space X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2007 02:23:35 -0000 To add another interesting bit to the puzzle... if I install both input and output pfil hooks, and use ping to generate network traffic, the writing to file in both the input and output hook works perfectly as well - even at high packet rates. Here's the weird bit: the second I try and initiate a TCP connection, I get a kernel panic. So it seems that it is only when I generate TCP outbound traffic that the kernel panic happens. If I telnet to a closed port on a valid IP, I don't get a panic. If I telnet to an open port on a valid IP, it doesn't panic until I attempt to send the first bit of user data down the socket... so it seems that it's panicing on threads that are sheparding outbound TCP user data through the kernel. Outbound TCP SYN and ACK pkts used in the 3 way handshake to establish TCP connection don't cause the panic. To me, that says that there is something funky going on with the threads that TCP connections use when sending packets down through the network stack. Can anyone shed some light on why threads that handle the processing of outbound TCP packets containing user data would cause a vnode write to fail because of a sleeping thread issue? From what I can gather, there must be some difference in the way the threads are created/configured... but I have no idea where to start looking to figure out what's going on here. Cheers, Lawrence