Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 1996 22:15:32 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, toor@dyson.iquest.net
Cc:        freebsd-current@freefall.freebsd.org, kuku@gilberto.physik.rwth-aachen.de, phk@critter.tfs.com
Subject:   Re: calcru: negative time:
Message-ID:  <199604031215.WAA17145@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>So we should probably make splvm: net_imask|bio_imask|tty_imask???
>(Keeping tty_imask mostly because of the possibility of some time in the
>future, the tty code needing to do malloc(s)?)

It's convenient to be able to call malloc(), but the prices is high:
higher latency and more races to avoid and more bugs when you don't
avoid the races.  I'd like to make splvm() a no-op or splsoftclock()
(mask only timeouts).  I think splimp() _was_ completely correct
because only the network interrupt handlers abused malloc().  This
is stupid because the network drivers can afford to drop packets
while the tty drivers can't, and the mallocations are mainly (only?)
used to grow the pool of mbuf clusters so the only benefit is that
the pool takes longer to reach its limit.

>Really, if we wanted to optimize the situation, we could limit the malloc
>code to net_imask (I don't think that anything else mallocs at interrupt
>level), and the rest of the VM to net_imask|bio_imask?  However,
>we need to document that very very carefully for future maintainers.

Like malloc(3) is very very carefully documented to not work in signal
handlers? ;-)

Bruce



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