summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2006-09-22 13:56:45 +0000
committerhunt <hunt>2006-09-22 13:56:45 +0000
commit52631162d5f249c88ec5fd0feafbaa88b66747ff (patch)
tree4b264d295ddd83efa21fa72658c09db6b3f3752b
parentfcecfdf8f361a342f21032251e6d8d441c5bb4a3 (diff)
downloadsystemtap-steved-52631162d5f249c88ec5fd0feafbaa88b66747ff.tar.gz
systemtap-steved-52631162d5f249c88ec5fd0feafbaa88b66747ff.tar.xz
systemtap-steved-52631162d5f249c88ec5fd0feafbaa88b66747ff.zip
2006-09-22 Martin Hunt <hunt@redhat.com>
* transport.c (_stp_work_queue): Reenable some cleanup code.
-rw-r--r--runtime/transport/ChangeLog5
-rw-r--r--runtime/transport/procfs.c22
-rw-r--r--runtime/transport/transport.c2
3 files changed, 24 insertions, 5 deletions
diff --git a/runtime/transport/ChangeLog b/runtime/transport/ChangeLog
index 855f52b2..83ccda7d 100644
--- a/runtime/transport/ChangeLog
+++ b/runtime/transport/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-22 Martin Hunt <hunt@redhat.com>
+
+ * transport.c (_stp_work_queue): Reenable some cleanup
+ code.
+
2006-09-21 Martin Hunt <hunt@redhat.com>
* transport.c (_stp_transport_init): Call _stp_print_init().
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c
index 857a36c7..90ceb58b 100644
--- a/runtime/transport/procfs.c
+++ b/runtime/transport/procfs.c
@@ -128,10 +128,17 @@ static int _stp_write (int type, void *data, int len)
{
struct _stp_buffer *bptr;
unsigned long flags;
+ unsigned numtrylock;
#define WRITE_AGG
#ifdef WRITE_AGG
- spin_lock_irqsave(&_stp_ready_lock, flags);
+
+ numtrylock = 0;
+ while (!spin_trylock_irqsave (&_stp_ready_lock, flags) && (++numtrylock < MAXTRYLOCK))
+ ndelay (TRYLOCKDELAY);
+ if (unlikely (numtrylock >= MAXTRYLOCK))
+ return 0;
+
if (!list_empty(&_stp_ready_q)) {
bptr = (struct _stp_buffer *)_stp_ready_q.prev;
if (bptr->len + len <= STP_BUFFER_SIZE
@@ -146,7 +153,12 @@ static int _stp_write (int type, void *data, int len)
spin_unlock_irqrestore(&_stp_ready_lock, flags);
#endif
- spin_lock_irqsave(&_stp_pool_lock, flags);
+ numtrylock = 0;
+ while (!spin_trylock_irqsave (&_stp_pool_lock, flags) && (++numtrylock < MAXTRYLOCK))
+ ndelay (TRYLOCKDELAY);
+ if (unlikely (numtrylock >= MAXTRYLOCK))
+ return 0;
+
if (list_empty(&_stp_pool_q)) {
spin_unlock_irqrestore(&_stp_pool_lock, flags);
return -1;
@@ -162,7 +174,11 @@ static int _stp_write (int type, void *data, int len)
bptr->len = len;
/* put it on the pool of ready buffers */
- spin_lock_irqsave(&_stp_ready_lock, flags);
+ numtrylock = 0;
+ while (!spin_trylock_irqsave (&_stp_ready_lock, flags) && (++numtrylock < MAXTRYLOCK))
+ ndelay (TRYLOCKDELAY);
+ if (unlikely (numtrylock >= MAXTRYLOCK))
+ return 0;
list_add_tail(&bptr->list, &_stp_ready_q);
spin_unlock_irqrestore(&_stp_ready_lock, flags);
diff --git a/runtime/transport/transport.c b/runtime/transport/transport.c
index fd50c92f..9277afca 100644
--- a/runtime/transport/transport.c
+++ b/runtime/transport/transport.c
@@ -179,11 +179,9 @@ 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))) {
_stp_cleanup_and_exit(0);
-/*
cancel_delayed_work(&stp_exit);
flush_workqueue(_stp_wq);
wake_up_interruptible(&_stp_proc_wq);
-*/
} else
queue_delayed_work(_stp_wq, &stp_exit, STP_WORK_TIMER);
}