From 13f754b1a53fc760c571042310cafd86623d17ad Mon Sep 17 00:00:00 2001 From: Jim Kukunas Date: Tue, 22 May 2012 13:54:03 +1000 Subject: [PATCH] --- yaml --- r: 305923 b: refs/heads/master c: 6a328475cccacb99a13b06978091da936dd51d89 h: refs/heads/master i: 305921: 50a0d1d38cfeeeb9875644684015ebac49ef4fb3 305919: e19180dc963c59f5aad55694958563b8cc0c1fcc v: v3 --- [refs] | 2 +- trunk/crypto/xor.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index ee69fe5eae67..a7ddb4fb6b10 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3ea7daa5d7fde47cd41f4d56c2deb949114da9d6 +refs/heads/master: 6a328475cccacb99a13b06978091da936dd51d89 diff --git a/trunk/crypto/xor.c b/trunk/crypto/xor.c index b75182d8ab14..87884435bddb 100644 --- a/trunk/crypto/xor.c +++ b/trunk/crypto/xor.c @@ -63,7 +63,7 @@ static void do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) { int speed; - unsigned long now; + unsigned long now, j; int i, count, max; tmpl->next = template_list; @@ -76,9 +76,11 @@ do_xor_speed(struct xor_block_template *tmpl, void *b1, void *b2) */ max = 0; for (i = 0; i < 5; i++) { - now = jiffies; + j = jiffies; count = 0; - while (jiffies == now) { + while ((now = jiffies) == j) + cpu_relax(); + while (time_before(jiffies, now + 1)) { mb(); /* prevent loop optimzation */ tmpl->do_2(BENCH_SIZE, b1, b2); mb();