Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2007 12:24:18 +1000
From:      Lawrence Stewart <lstewart@room52.net>
To:        =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Writing a plain text file to disk from kernel space
Message-ID:  <4653A5D2.4070209@room52.net>
In-Reply-To: <465397FB.9080309@room52.net>
References:  <4649349D.4060101@room52.net>	<200705150847.38838.marc.loerner@hob.de>	<46499491.2010205@room52.net>	<f2j5hf$hap$2@sea.gmane.org>	<46515DE0.20209@room52.net>	<86sl9qtpd1.fsf@dwp.des.no>	<4652AD8C.7000605@room52.net> <86r6p9md2n.fsf@dwp.des.no> <465397FB.9080309@room52.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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