crash-suspend "teardown races"

David Smith dsmith at redhat.com
Wed Jul 30 21:19:44 UTC 2008


For background to this email, read the "teardown races" section in
utrace.txt and Roland's "asynchronous detach" email.

The crash-suspend.c example suffers from the "teardown races" problem.
(Since systemtap's utrace code is a more elaborate version of
crash-suspend.c, systemtap has the same problem.)  So, I've attempted to
come up with a solution that doesn't pervert the example too much.

I've attached a patch with the details.  Basically, at module unload
time, instead of detaching directly, it tries to asynchronously stop all
the threads we're attached to and then let the quiesce handler detach
from the thread.  The semi-tricky part was letting the module unload
function, exit_crash_suspend(), know when all threads that we had
attached to were detached.  To do this, the code keeps up with an attach
count.  When the attach count reaches 0, the module unload function gets
woken up to go ahead and exit.

I'd appreciate any thoughts, criticisms, etc. on this patch, which I've
tested under kernel 2.6.27-0.186.rc0.git15.fc10.

-- 
David Smith
dsmith at redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: crash-suspend.patch
URL: <http://listman.redhat.com/archives/utrace-devel/attachments/20080730/12f32550/attachment.ksh>


More information about the utrace-devel mailing list