1 From 15bdf68bea3b376dc7700b6c4a468fff40405a6b Mon Sep 17 00:00:00 2001
2 From: Ingo Molnar <mingo@elte.hu>
3 Date: Fri, 3 Jul 2009 08:44:07 -0500
4 Subject: [PATCH 076/366] relay: Fix timer madness
6 remove timer calls (!!!) from deep within the tracing infrastructure.
7 This was totally bogus code that can cause lockups and worse. Poll
8 the buffer every 2 jiffies for now.
10 Signed-off-by: Ingo Molnar <mingo@elte.hu>
11 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 kernel/relay.c | 14 +++++---------
14 1 file changed, 5 insertions(+), 9 deletions(-)
16 diff --git a/kernel/relay.c b/kernel/relay.c
17 index 0b4570c..60684be 100644
20 @@ -336,6 +336,10 @@ static void wakeup_readers(unsigned long data)
22 struct rchan_buf *buf = (struct rchan_buf *)data;
23 wake_up_interruptible(&buf->read_wait);
25 + * Stupid polling for now:
27 + mod_timer(&buf->timer, jiffies + 1);
31 @@ -353,6 +357,7 @@ static void __relay_reset(struct rchan_buf *buf, unsigned int init)
32 init_waitqueue_head(&buf->read_wait);
33 kref_init(&buf->kref);
34 setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf);
35 + mod_timer(&buf->timer, jiffies + 1);
37 del_timer_sync(&buf->timer);
39 @@ -736,15 +741,6 @@ size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)
41 buf->early_bytes += buf->chan->subbuf_size -
42 buf->padding[old_subbuf];
44 - if (waitqueue_active(&buf->read_wait))
46 - * Calling wake_up_interruptible() from here
47 - * will deadlock if we happen to be logging
48 - * from the scheduler (trying to re-grab
49 - * rq->lock), so defer it.
51 - mod_timer(&buf->timer, jiffies + 1);