From owner-freebsd-hackers Tue Apr 2 13:26:52 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 59D3737B405; Tue, 2 Apr 2002 13:26:46 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 43957AE03F; Tue, 2 Apr 2002 13:26:46 -0800 (PST) Date: Tue, 2 Apr 2002 13:26:46 -0800 From: Alfred Perlstein To: hackers@freebsd.org Cc: dillon@freebsd.org, jeffr@freebsd.org Subject: mpsafe malloc Message-ID: <20020402212646.GV93885@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Started looking at making malloc mpsafe. First issue I came across was this brokenish code in uma_core.c:page_alloc(): if (lockstatus(&kernel_map->lock, NULL)) { *pflag = UMA_SLAB_KMEM; p = (void *) kmem_malloc(kmem_map, bytes, wait); } else { *pflag = UMA_SLAB_KMAP; p = (void *) kmem_alloc(kernel_map, bytes); } using lockstatus won't work for smp. I think a solution is to do a trylock on the kmem_map, then have kmem_malloc either recurse on the lock, or take a flag to tell it not to bother locking. ? -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message