Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Aug 2003 14:18:24 -0700 (PDT)
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 35360 for review
Message-ID:  <200308012118.h71LIOTC024928@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=35360

Change 35360 by sam@sam_ebb on 2003/08/01 14:18:01

	Change some malloc's to use M_NOWAIT to eliinate sleeping
	while holding a lock.  This is a bandaid to be fixed later
	since they should be able to block except for this code 
	being called on interface transitions and that should be
	handled by dispatching the operation to a context that can
	block.

Affected files ...

.. //depot/projects/netperf/sys/net/bridge.c#2 edit

Differences ...

==== //depot/projects/netperf/sys/net/bridge.c#2 (text+ko) ====

@@ -246,7 +246,7 @@
     }
     c[n_clusters].ht = (struct hash_table *)
 	    malloc(HASH_SIZE * sizeof(struct hash_table),
-		M_IFADDR, M_WAITOK | M_ZERO);
+		M_IFADDR, M_NOWAIT | M_ZERO);
     if (c[n_clusters].ht == NULL) {
 	printf("-- bridge: cannot allocate hash table for new cluster\n");
 	free(c, M_IFADDR);
@@ -254,7 +254,7 @@
     }
     c[n_clusters].my_macs = (struct bdg_addr *)
 	    malloc(BDG_MAX_PORTS * sizeof(struct bdg_addr),
-		M_IFADDR, M_WAITOK | M_ZERO);
+		M_IFADDR, M_NOWAIT | M_ZERO);
     if (c[n_clusters].my_macs == NULL) {
         printf("-- bridge: cannot allocate mac addr table for new cluster\n");
 	free(c[n_clusters].ht, M_IFADDR);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308012118.h71LIOTC024928>