kern/54890: [PATCH] don't hold Giant when calling kmem_malloc
Lukas Ertl
l.ertl at univie.ac.at
Sat Jul 26 17:10:17 PDT 2003
>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 at 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:
More information about the freebsd-bugs
mailing list