From owner-p4-projects@FreeBSD.ORG Wed Sep 28 20:25:14 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 606EF16A422; Wed, 28 Sep 2005 20:25:14 +0000 (GMT) X-Original-To: perforce@freebsd.org 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 BE65E16A41F for ; Wed, 28 Sep 2005 20:25:13 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3543B43D55 for ; Wed, 28 Sep 2005 20:25:13 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j8SKPClP047349 for ; Wed, 28 Sep 2005 20:25:12 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j8SKPCUF047346 for perforce@freebsd.org; Wed, 28 Sep 2005 20:25:12 GMT (envelope-from jhb@freebsd.org) Date: Wed, 28 Sep 2005 20:25:12 GMT Message-Id: <200509282025.j8SKPCUF047346@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 84453 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Sep 2005 20:25:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=84453 Change 84453 by jhb@jhb_slimer on 2005/09/28 20:25:08 Not a race. el_runcount already handles this. Affected files ... .. //depot/projects/smpng/sys/notes#60 edit Differences ... ==== //depot/projects/smpng/sys/notes#60 (text+ko) ==== @@ -75,49 +75,6 @@ - arm, powerpc? - fork counts? - Add a cache-line padded mtx_aligned union and use it for the mutex pools. -- Fix free race in eventhandlers: -> In the macro "_EVENTHANDLER_INVOKE" in the file -> "/sys/sys/eventhandler.h", you unlock the list lock -> before calling the callback. That make sense. But what -> happens if one process is in the callback, and another -> process is deregistering this tag. -> -> The solution is that the last thread -> that has anything to do with a entry -> frees it: -> -> TAILQ_FOREACH() -> { -> refcount++; -> -> EHL_UNLOCK(); -> -> callback(); -> -> EHL_LOCK(); -> -> refcount--; -> -> if(refcount == 0) -> free(entry); -> } -> -> At init: -> refcount = 1; -> -> -> At deregister: -> -> EHL_LOCK(); -> -> refcount--; -> if(refcount == 0) -> free(); -> -> EHL_UNLOCK(); -> -> --HPS -> Active child branches: - jhb_intr - intr_event stuff