From owner-freebsd-current Fri Jan 10 9:28:12 2003 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 C475D37B401; Fri, 10 Jan 2003 09:28:10 -0800 (PST) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id 08F8943F5B; Fri, 10 Jan 2003 09:28:10 -0800 (PST) (envelope-from sam@errno.com) Received: from melange (melange.errno.com [66.127.85.82]) (authenticated bits=0) by ebb.errno.com (8.12.5/8.12.1) with ESMTP id h0AHS9nN002377 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 10 Jan 2003 09:28:09 -0800 (PST)?g (envelope-from sam@errno.com)œ X-Authentication-Warning: ebb.errno.com: Host melange.errno.com [66.127.85.82] claimed to be melange Message-ID: <12d201c2b8cd$a52a1440$52557f42@errno.com> From: "Sam Leffler" To: "Tim Robbins" , "Juli Mallett" Cc: , References: <20030110013015.A23399@FreeBSD.org> <20030110215736.A31727@dilbert.robbins.dropbear.id.au> <20030111004226.A36261@dilbert.robbins.dropbear.id.au> Subject: Re: Serious issues with kqueue on sockets on CURRENT. Date: Fri, 10 Jan 2003 09:28:09 -0800 Organization: Errno Consulting MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 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 Fri, Jan 10, 2003 at 09:57:36PM +1100, Tim Robbins wrote: > > > On Fri, Jan 10, 2003 at 01:30:16AM -0800, Juli Mallett wrote: > > > > > Lately, the data field for sockets, which holds bytes ready (in the EVFILT_ > > > READ case) to be read, is computed to be zero. This means that if you have > > > a low watermark which is >0 per the kq, THE EVENT WILL NEVER HAPPEN. Not to > > > mention that this means when the event IS triggered properly (if you can > > > call it that), it is always said to have =ZERO= bytes ready. > > [...] > > > > I can definitely reproduce this here and also fairly angry about it. > > In addition to what you mentioned, fstat() gives an incorrect st_size > > result now and it's likely that non-NOTE_LOWAT low watermarks are > > firing too early as well. > > > > Ugly test program @ http://people.freebsd.org/~tjr/kq.c > > From what I can tell, mbufs with m_type == MT_HEADER can store data > as well as those with m_type == MT_DATA. This patch corrects the > tests in sbcompress(), sbdrop(), sballoc() and sbfree() so that data > stored in MT_HEADER mbufs is not included in sb_ctl. I'd appreciate > comments from people who have a good understanding of this code. You're correct the MT_HEADER-type mbufs may have data in them. Using the mbuf type to infer the type of data held within is probably a bad idea unless the mbufs are specifically tagged as such. I'm not clear on exactly what sb_ctl is supposed to count; the comment in the cvs log is unclear: "Track the number of non-data chararacters stored in socket buffers so that the data value returned by kevent()'s EVFILT_READ filter on non-TCP sockets accurately reflects the amount of data that can be read from the sockets by applications." What are "non-data characters"? Sam To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message