From owner-freebsd-current Tue Jun 27 21:40:15 2000 Delivered-To: freebsd-current@freebsd.org Received: from falla.videotron.net (falla.videotron.net [205.151.222.106]) by hub.freebsd.org (Postfix) with ESMTP id D89F437B924 for ; Tue, 27 Jun 2000 21:40:12 -0700 (PDT) (envelope-from bmilekic@dsuper.net) Received: from modemcable009.62-201-24.mtl.mc.videotron.net ([24.201.62.9]) by falla.videotron.net (Sun Internet Mail Server sims.3.5.1999.12.14.10.29.p8) with ESMTP id <0FWU0081JKI09S@falla.videotron.net> for current@FreeBSD.ORG; Wed, 28 Jun 2000 00:30:00 -0400 (EDT) Date: Wed, 28 Jun 2000 00:31:57 -0400 (EDT) From: Bosko Milekic Subject: Re: Questions about kmem_malloc and SPL levels In-reply-to: X-Sender: bmilekic@jehovah.technokratis.com To: Bruce Evans Cc: John Polstra G , current@FreeBSD.ORG Message-id: MIME-version: 1.0 Content-type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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