Skip to contentSkip to conversation

rcutorture: mod_timer() takes an absolute time

PATCH In review Dan Carpenter 2 participants 2 messages Feb 22, 2010 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcutorture: mod_timer() takes an absolute time

Hi Paul,

I was inspired to write a smatch check based on:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h¸57df1acc634b18db1db2a40864af985100266e

I compiled it and modprobed the resulting module... Is this correct, or did you intend for the timer to trigger right away?

kernel/rcutorture.c +1 -1
index 9bb5217..1970f61 100644
@@ -798,7 +798,7 @@ rcu_torture_reader(void *arg)
 	do {
 		if (irqreader && cur_ops->irq_capable) {
 			if (!timer_pending(&t))
-				mod_timer(&t, 1);
+				mod_timer(&t, jiffies + 1);
 		}
 		idx = cur_ops->readlock();
 		completed = cur_ops->completed();

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

#1 lore raw
Quoted 7 lines · Dan Carpenter

Hi Paul,

I was inspired to write a smatch check based on:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h¸57df1acc634b18db1db2a40864af985100266e

I compiled it and modprobed the resulting module... Is this correct, or did you intend for the timer to trigger right away?

Excellent catch, Dan! Applied.

Thanx, Paul

Quoted 7 lines
kernel/rcutorture.c +0 -0
index 9bb5217..1970f61 100644

kernel/rcutorture.c rcu_torture_reader(void *arg) · line 804

Quoted 8 lines
kernel/rcutorture.c +1 -1
@@ -798,7 +798,7 @@ rcu_torture_reader(void *arg)
 	do {
 		if (irqreader && cur_ops->irq_capable) {
 			if (!timer_pending(&t))
-				mod_timer(&t, 1);
+				mod_timer(&t, jiffies + 1);
 		}
 		idx = cur_ops->readlock();
 		completed = cur_ops->completed();

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