Skip to contentSkip to conversation

add cpu_relax to hrtimer_cancel

PATCH In review Joe Korty 2 participants 2 messages Apr 3, 2006

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 add cpu_relax to hrtimer_cancel

Add a cpu_relax() to the hand-coded spinwait in hrtimer_cancel().

 2.6.17-rc1-jak/kernel/hrtimer.c |    1 +
 1 file changed, 1 insertion(+)
kernel/hrtimer.c renamed from kernel/hrtimer.c~add.cpu_relax.to.hrtimer_cancel +1 -0
diff -puNa kernel/hrtimer.c~add.cpu_relax.to.hrtimer_cancel kernel/hrtimer.c
@@ -501,6 +501,7 @@ int hrtimer_cancel(struct hrtimer *timer
 
 		if (ret >= 0)
 			return ret;
+		cpu_relax();
 	}
 }
 

_

#1 lore raw
Quoted 20 lines · Joe Korty

Add a cpu_relax() to the hand-coded spinwait in hrtimer_cancel().

 2.6.17-rc1-jak/kernel/hrtimer.c |    1 +
 1 file changed, 1 insertion(+)

diff -puNa kernel/hrtimer.c~add.cpu_relax.to.hrtimer_cancel kernel/hrtimer.c

kernel/hrtimer.c renamed from kernel/hrtimer.c~add.cpu_relax.to.hrtimer_cancel +1 -0
@@ -501,6 +501,7 @@ int hrtimer_cancel(struct hrtimer *timer
 
 		if (ret >= 0)
 			return ret;
+		cpu_relax();
 	}
 }
 
Quoted 1 line

_

Doh. It had been there once ..:)