Date: Sun, 27 Jul 2003 02:03:02 +0200 (CEST) From: Lukas Ertl <l.ertl@univie.ac.at> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/54890: [PATCH] don't hold Giant when calling kmem_malloc Message-ID: <200307270003.h6R032HI092632@korben.in.tern> Resent-Message-ID: <200307270010.h6R0AGaV021264@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 54890 >Category: kern >Synopsis: [PATCH] don't hold Giant when calling kmem_malloc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Jul 26 17:10:15 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Lukas Ertl >Release: FreeBSD 5.1-CURRENT i386 >Organization: Vienna University Computer Center >Environment: System: FreeBSD korben 5.1-CURRENT FreeBSD 5.1-CURRENT #10: Sat Jul 26 19:16:52 CEST 2003 le@korben:/usr/obj/usr/src/sys/KORBEN i386 >Description: I'm not quite sure, but I think we don't have to hold Giant anymore when we are calling kmem_malloc. >How-To-Repeat: >Fix: --- uma_core.c.diff begins here --- Index: sys/vm/uma_core.c =================================================================== RCS file: /usr/local/bsdcvs/src/sys/vm/uma_core.c,v retrieving revision 1.62 diff -u -r1.62 uma_core.c --- sys/vm/uma_core.c 26 Jul 2003 03:55:32 -0000 1.62 +++ sys/vm/uma_core.c 26 Jul 2003 17:14:09 -0000 @@ -706,15 +706,8 @@ wait &= ~M_ZERO; if (booted || (zone->uz_flags & UMA_ZFLAG_PRIVALLOC)) { - if ((wait & M_NOWAIT) == 0) { - mtx_lock(&Giant); - mem = zone->uz_allocf(zone, - zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait); - mtx_unlock(&Giant); - } else { - mem = zone->uz_allocf(zone, - zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait); - } + mem = zone->uz_allocf(zone, + zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait); if (mem == NULL) { ZONE_LOCK(zone); return (NULL); --- uma_core.c.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200307270003.h6R032HI092632>