From owner-freebsd-current Thu Aug 24 6:10:14 2000 Delivered-To: freebsd-current@freebsd.org Received: from localhost (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id A752D37B424; Thu, 24 Aug 2000 06:10:10 -0700 (PDT) Date: Thu, 24 Aug 2000 09:10:09 -0400 (EDT) From: Brian Fundakowski Feldman X-Sender: green@green.dyndns.org To: Alfred Perlstein Cc: John Polstra , current@FreeBSD.ORG Subject: Re: panic: reducing sbsize: lost count, uid = 1001 In-Reply-To: <20000823145244.J4854@fw.wintelcom.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Try making them small critical sections. If it makes it easier, which it probably will, try this: pass the pointer to sb_hiwat as an argument to chgsbsize and make that the only way to modify it (sockbuf creation would have to be a place where it's initialized manually to 0 ;) I'd say stick the hiwat increment of delta at the end, after malloc, since that would place it in the same context as the setting. Luckily, doing this right would be making the code clearer in several of the (few) places sb_hiwat is used. We just have to assure that sb_hiwat is always consistent with the ui_sbsize which can be done with a critical section that "knows" the delta to apply and where to apply it. Using splimp() should not be necessary as that is used for mbuf protection, which is why network card drivers' interrupts must be called at splimp() (an aggregate mask which includes splnet()): they need to not corrupt the mbuf subsystem. Plus, it makes a convenient critical section for the network drivers in this way :) At least, this is how I learned it to be. I'm not sure if it's absolutely correct, but it should be. -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message