lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 27 Jul 2013 15:04:43 +0800
From:	"zhangwei(Jovi)" <jovi.zhangwei@...wei.com>
To:	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...hat.com>
CC:	Dan Carpenter <dan.carpenter@...cle.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Jens Axboe <axboe@...nel.dk>,
	Al Viro <viro@...iv.linux.org.uk>,
	Eric Dumazet <edumazet@...gle.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
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) <jovi.zhangwei@...wei.com>
Cc: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Ingo Molnar <mingo@...e.hu>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Eric Dumazet <edumazet@...gle.com>
---
 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 majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ