From owner-freebsd-current Tue Jun 27 10:46:13 2000 Delivered-To: freebsd-current@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 5D34F37C13F for ; Tue, 27 Jun 2000 10:46:09 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e5RHk6m26624; Tue, 27 Jun 2000 10:46:06 -0700 (PDT) Date: Tue, 27 Jun 2000 10:46:06 -0700 From: Alfred Perlstein To: John Polstra G Cc: current@FreeBSD.ORG Subject: Re: Questions about kmem_malloc and SPL levels Message-ID: <20000627104606.L275@fw.wintelcom.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from jdp@polstra.com on Tue, Jun 27, 2000 at 10:37:56AM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * John Polstra G [000627 10:38] wrote: > The comment leading into kmem_malloc (in sys/vm/vm_kern.c) is > worrying me: > > * This routine has its own private kernel submap (kmem_map) and object > * (kmem_object). This, combined with the fact that only malloc uses > * this routine, ensures that we will never block in map or object waits. > > Actually, this function is called by m_clalloc (in > sys/kern/uipc_mbuf.c) too. The comment is obviously wrong. Is it a > problem that this assumption is violated? > > * Note that this still only works in a uni-processor environment and > * when called at splhigh(). > > 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? The comment is wrong, the idea is that only network interupts are expected to play with the mbmap, therefore we only need to block network interrupts during mbuf allocation. The general malloc pool can be accessed from any interrupt and therefore needs protection at splhigh. If there were 'diskbufs' and they had thier own private map then you'd only really need splbio wrapped around the call. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message