Changed from v2:
mod timer interval changed from HZ/10 to jiffies + HZ/10,
as Dan Carpenter suggested.

This patch is based on -mm tree.

Signed-off-by: zhangwei(Jovi) <[email protected]>
Cc: Dan Carpenter <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Eric Dumazet <[email protected]>
---
 kernel/relay.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 87af4ce..42d6de3 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -342,7 +342,7 @@ static void wakeup_readers(unsigned long data)
        /*
         * Stupid polling for now:
         */
-       mod_timer(&buf->timer, HZ / 10);
+       mod_timer(&buf->timer, jiffies + HZ / 10);
 }

 /**
@@ -360,7 +360,7 @@ static void __relay_reset(struct rchan_buf *buf, unsigned 
int init)
                init_waitqueue_head(&buf->read_wait);
                kref_init(&buf->kref);
                setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf);
-               mod_timer(&buf->timer, HZ / 10);
+               mod_timer(&buf->timer, jiffies + HZ / 10);
        } else
                del_timer_sync(&buf->timer);

-- 
1.7.9.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to