On Wed, 28 Jun 2000, Bruce Evans wrote:
> > The first part will be news to the folks running SMP. :-) The business
> > about splhigh is also wrong. But what worries me is that malloc calls
> > it at splmem, while m_clalloc calls it at splimp. Is that a problem?
>
> malloc() calls it on kmem_map while m_clalloc() call it on mb_map, so I
> think there is no problem in principle. vm just has to call splvm()
> itself and not depend on kmem_malloc() being called at splvm() (so the
> comment is broken in yet another way).
>
> Bruce
There is a general inconsistency in the vm code it seems, for what
concerns this issue. I noticed it while looking at the mbuf stuff. As you
mention, kmem_malloc() should really just raise to splvm() itself, as do
some other routines already in such a situation (look at vm_map).
As in the mbuf stuff I seperated mb_map into two parts: mb_map and
mcl_map, the long if () statements in vm_map became tedious, not to
mention, a slight loss in speed, so what I did (after Emailing dillon
about it) was add an alloc_intr field in the vm_map. This is set to 1 for
kmem_map, mb_map, and mcl_map, and is checked in the vm_map stuff to
decide whether to raise to splvm(), and should probably also be checked
in kmem_malloc() for the same reason as well. However, I suspect that
kmem_malloc calls some of those vm_map routines at one point or another
and they take care of raising to splvm() when necessary, so I don't
suspect a critical problem. The question is exactly: How much of
kmem_malloc needs to be under splvm() ?
In any case, the comment needs to be changed ASAP (I Emailed the
lists myself about this maybe on 2 different occasions before and have
gotten no reply).
--Bosko
--
Bosko Milekic * Voice/Mobile: 514.865.7738 * Pager: 514.921.0237
[EMAIL PROTECTED] * http://www.technokratis.com/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message