Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Aug 2000 09:10:09 -0400 (EDT)
From:      Brian Fundakowski Feldman <green@FreeBSD.org>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        John Polstra <jdp@polstra.com>, current@FreeBSD.ORG
Subject:   Re: panic: reducing sbsize: lost count, uid = 1001
Message-ID:  <Pine.BSF.4.21.0008240849390.52828-100000@green.dyndns.org>
In-Reply-To: <20000823145244.J4854@fw.wintelcom.net>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0008240849390.52828-100000>