Date: Wed, 28 Jun 2000 00:31:57 -0400 (EDT) From: Bosko Milekic <bmilekic@dsuper.net> To: Bruce Evans <bde@zeta.org.au> Cc: John Polstra G <jdp@polstra.com>, current@FreeBSD.ORG Subject: Re: Questions about kmem_malloc and SPL levels Message-ID: <Pine.BSF.4.21.0006280025450.1650-100000@jehovah.technokratis.com> In-Reply-To: <Pine.BSF.4.21.0006281219270.7105-100000@besplex.bde.org>
index | next in thread | previous in thread | raw e-mail
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
bmilekic@technokratis.com * http://www.technokratis.com/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0006280025450.1650-100000>
