From owner-p4-projects@FreeBSD.ORG Fri Aug 1 14:18:27 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DC62A37B43A; Fri, 1 Aug 2003 14:18:26 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 03F1A37B49E for ; Fri, 1 Aug 2003 14:18:25 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15E1043F93 for ; Fri, 1 Aug 2003 14:18:25 -0700 (PDT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h71LIO0U024931 for ; Fri, 1 Aug 2003 14:18:24 -0700 (PDT) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h71LIOTC024928 for perforce@freebsd.org; Fri, 1 Aug 2003 14:18:24 -0700 (PDT) Date: Fri, 1 Aug 2003 14:18:24 -0700 (PDT) Message-Id: <200308012118.h71LIOTC024928@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 35360 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2003 21:18:27 -0000 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);