Date: Wed, 28 Sep 2005 20:25:12 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 84453 for review Message-ID: <200509282025.j8SKPCUF047346@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509282025.j8SKPCUF047346>