projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update
[lttv.git]
/
tests
/
kernel
/
test-rcu-speed.c
diff --git
a/tests/kernel/test-rcu-speed.c
b/tests/kernel/test-rcu-speed.c
index 827b2cebe3dada2d9201859914f659ac65a78e3a..15fbe7029c3f08874e786c64d95d7b94a52ef3b4 100644
(file)
--- a/
tests/kernel/test-rcu-speed.c
+++ b/
tests/kernel/test-rcu-speed.c
@@
-9,6
+9,8
@@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/calc64.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/calc64.h>
+#include <linux/spinlock.h>
+#include <linux/seqlock.h>
#include <asm/timex.h>
#include <asm/system.h>
#include <asm/timex.h>
#include <asm/system.h>
@@
-18,7
+20,6
@@
int test_val;
static void do_testbaseline(void)
{
static void do_testbaseline(void)
{
- int ret;
long flags;
unsigned int i;
cycles_t time1, time2, time;
long flags;
unsigned int i;
cycles_t time1, time2, time;
@@
-45,22
+46,21
@@
static void do_testbaseline(void)
static void do_test_spinlock(void)
{
static void do_test_spinlock(void)
{
- static DEFINE_SPINLOCK mylock;
- int ret;
+ static DEFINE_SPINLOCK(mylock);
long flags;
unsigned int i;
cycles_t time1, time2, time;
long rem;
preempt_disable();
long flags;
unsigned int i;
cycles_t time1, time2, time;
long rem;
preempt_disable();
- spin_lock_irqsave(flags);
+ spin_lock_irqsave(
&mylock,
flags);
time1 = get_cycles();
for (i = 0; i < NR_LOOPS; i++) {
time1 = get_cycles();
for (i = 0; i < NR_LOOPS; i++) {
- spin_unlock
_irqrestore(flags
);
- spin_lock
_irqsave(flags
);
+ spin_unlock
(&mylock
);
+ spin_lock
(&mylock
);
}
time2 = get_cycles();
}
time2 = get_cycles();
- spin_unlock_irqrestore(flags);
+ spin_unlock_irqrestore(
&mylock,
flags);
preempt_enable();
time = time2 - time1;
preempt_enable();
time = time2 - time1;
@@
-75,7
+75,7
@@
static void do_test_spinlock(void)
static void do_test_seqlock(void)
{
static seqlock_t test_lock;
static void do_test_seqlock(void)
{
static seqlock_t test_lock;
-
int ret
;
+
unsigned long seq
;
long flags;
unsigned int i;
cycles_t time1, time2, time;
long flags;
unsigned int i;
cycles_t time1, time2, time;
@@
-116,8
+116,8
@@
static void do_test_preempt(void)
preempt_disable();
time1 = get_cycles();
for (i = 0; i < NR_LOOPS; i++) {
preempt_disable();
time1 = get_cycles();
for (i = 0; i < NR_LOOPS; i++) {
- preempt_enable();
preempt_disable();
preempt_disable();
+ preempt_enable();
}
time2 = get_cycles();
preempt_enable();
}
time2 = get_cycles();
preempt_enable();
This page took
0.0259779999999999 seconds
and
4
git commands to generate.