2013-07-27 07:06:40

by zhangwei(Jovi)

[permalink] [raw]
Subject: [PATCH] relay: fix timer madness v3

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


2013-07-27 10:26:39

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] relay: fix timer madness v3

On Sat, Jul 27, 2013 at 03:04:43PM +0800, zhangwei(Jovi) wrote:
> 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.

This is one of those guess-what-I'm-thinking commit messages. Can you
please write it this way:

The situation currently is A, the bug is B, I'm fixing it by doing C.

Don't be afraid to be more verbose.

An innocent bystander can only guess why the change was done and I'm
willing to bet good money that a couple of years from now, not even you
will know why you did it.

Thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--