summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2006-06-09 19:54:52 +0000
committerhunt <hunt>2006-06-09 19:54:52 +0000
commita32e6838f25060b0a62f97cc31c6f3a10fb1fffa (patch)
treebd6fdacae6f77f0a410d1e80824cd4825a88e625
parent7f5044ebdef2e414d256b47cb49ac953b0f5cce7 (diff)
downloadsystemtap-steved-a32e6838f25060b0a62f97cc31c6f3a10fb1fffa.tar.gz
systemtap-steved-a32e6838f25060b0a62f97cc31c6f3a10fb1fffa.tar.xz
systemtap-steved-a32e6838f25060b0a62f97cc31c6f3a10fb1fffa.zip
2006-06-09 Martin Hunt <hunt@redhat.com>
* transport.c: Using the default workqueue was causing problems because of the long delays on probe_exit(). Created a new systemtap work queue and used that instead.
-rw-r--r--runtime/transport/ChangeLog6
-rw-r--r--runtime/transport/transport.c12
2 files changed, 16 insertions, 2 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index 9f43ccfc..11461fef 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-09 Martin Hunt <hunt@redhat.com>
+
+ * transport.c: Using the default workqueue was causing problems
+ because of the long delays on probe_exit(). Created a new
+ systemtap work queue and used that instead.
+
2006-06-05 Martin Hunt <hunt@redhat.com>
* procfs.c (_stp_write): Always use spin_lock_irqsave() because
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index 3acd152e..26e6dd9a 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -40,6 +40,7 @@ void _stp_exit(void);
void _stp_handle_start (struct transport_start *st);
static void _stp_work_queue (void *data);
static DECLARE_WORK(stp_exit, _stp_work_queue, NULL);
+static struct workqueue_struct *_stp_wq;
int _stp_transport_open(struct transport_info *info);
#include "procfs.c"
@@ -130,7 +131,9 @@ static void _stp_cleanup_and_exit (int dont_rmmod)
if (!_stp_exit_called) {
_stp_exit_called = 1;
+ kbug("calling probe_exit\n");
probe_exit();
+ kbug("done with probe_exit\n");
failures = atomic_read(&_stp_transport_failures);
if (failures)
@@ -141,7 +144,9 @@ static void _stp_cleanup_and_exit (int dont_rmmod)
relay_flush(_stp_chan);
}
#endif
+ kbug("transport_send STP_EXIT\n");
_stp_transport_send(STP_EXIT, &dont_rmmod, sizeof(int));
+ kbug("done with transport_send STP_EXIT\n");
}
}
@@ -164,10 +169,11 @@ static void _stp_work_queue (void *data)
/* if exit flag is set AND we have finished with probe_start() */
if (unlikely(_stp_exit_flag && atomic_read(&_stp_start_finished))) {
cancel_delayed_work(&stp_exit);
+ flush_workqueue(_stp_wq);
_stp_cleanup_and_exit(0);
wake_up_interruptible(&_stp_proc_wq);
} else
- schedule_delayed_work(&stp_exit, STP_WORK_TIMER);
+ queue_delayed_work(_stp_wq, &stp_exit, STP_WORK_TIMER);
}
/**
@@ -180,6 +186,7 @@ void _stp_transport_close()
{
kbug("************** transport_close *************\n");
cancel_delayed_work(&stp_exit);
+ flush_workqueue(_stp_wq);
_stp_cleanup_and_exit(1);
wake_up_interruptible(&_stp_proc_wq);
#ifdef STP_RELAYFS
@@ -260,7 +267,8 @@ int _stp_transport_init(void)
if (_stp_register_procfs() < 0)
return -1;
- schedule_delayed_work(&stp_exit, STP_WORK_TIMER);
+ _stp_wq = create_workqueue("systemtap");
+ queue_delayed_work(_stp_wq, &stp_exit, STP_WORK_TIMER);
return 0;
}