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

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!  /
 [EMAIL PROTECTED]                    `------------------------------'

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to