From: davem@davemloft.net (David Miller)
Subject: [ltt-dev] cli/sti vs local_cmpxchg and local_add_return
Date: Mon, 16 Mar 2009 20:37:05 -0700 (PDT) [thread overview]
Message-ID: <20090316.203705.218202510.davem@davemloft.net> (raw)
In-Reply-To: <20090317013220.GA22474@Krystal>
From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Date: Mon, 16 Mar 2009 21:32:20 -0400
> If some of you would be kind enough to run my test module provided below
> and provide the results of these tests on a recent kernel (2.6.26~2.6.29
> should be good) along with their cpuinfo, I would greatly appreciate.
Here's sparc64, but cycles is always computed as zero.
Probably that's because get_cycles() on sparc64 counts system
bus clock cycles, not CPU cycles, and you the loop iteration
isn't expensive enough to get a system clock tick in.
This is a dual UltraSPARC-IIIi at 1.2 GHz
[1052598.484452] test init
[1052598.486230] test results: time for baseline
[1052598.487878] number of loops: 20000
[1052598.489485] total time: 752
[1052598.491061] -> baseline takes 0 cycles
[1052598.492649] test end
[1052598.494874] test results: time for locked cmpxchg
[1052598.496460] number of loops: 20000
[1052598.498005] total time: 7879
[1052598.499521] -> locked cmpxchg takes 0 cycles
[1052598.501060] test end
[1052598.503194] test results: time for non locked cmpxchg
[1052598.504733] number of loops: 20000
[1052598.506213] total time: 7879
[1052598.507722] -> non locked cmpxchg takes 0 cycles
[1052598.509229] test end
[1052598.511347] test results: time for locked add return
[1052598.512821] number of loops: 20000
[1052598.514265] total time: 8254
[1052598.515682] -> locked add return takes 0 cycles
[1052598.517130] test end
[1052598.519427] test results: time for non locked add return
[1052598.520850] number of loops: 20000
[1052598.522230] total time: 11259
[1052598.523561] -> non locked add return takes 0 cycles
[1052598.524939] test end
[1052598.526393] test results: time for enabling interrupts (STI)
[1052598.527767] number of loops: 20000
[1052598.529085] total time: 1877
[1052598.530373] -> enabling interrupts (STI) takes 0 cycles
[1052598.531713] test end
[1052598.533240] test results: time for disabling interrupts (CLI)
[1052598.534594] number of loops: 20000
[1052598.535892] total time: 3189
[1052598.537189] -> disabling interrupts (CLI) takes 0 cycles
[1052598.538551] test end
[1052598.540176] test results: time for disabling/enabling interrupts (STI/CLI)
[1052598.541579] number of loops: 20000
[1052598.542900] total time: 3940
[1052598.544207] -> enabling/disabling interrupts (STI/CLI) takes 0 cycles
[1052598.545595] test end
next prev parent reply other threads:[~2009-03-17 3:37 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 1:32 Mathieu Desnoyers
2009-03-17 3:37 ` David Miller [this message]
2009-03-17 4:10 ` Mathieu Desnoyers
2009-03-17 4:27 ` David Miller
2009-03-17 4:44 ` Mathieu Desnoyers
2009-03-17 5:01 ` Paul E. McKenney
2009-03-17 16:06 ` Mathieu Desnoyers
2009-03-17 19:28 ` David Miller
2009-03-17 19:35 ` Mathieu Desnoyers
2009-03-17 6:05 ` Nick Piggin
2009-03-17 15:14 ` Mathieu Desnoyers
2009-03-18 11:43 ` Nick Piggin
2009-03-18 15:10 ` Mathieu Desnoyers
2009-03-17 18:42 ` Alan D. Brunelle
2009-03-17 19:01 ` Andika Triwidada
2009-03-23 16:50 ` Mathieu Desnoyers
2009-03-18 11:56 ` Josh Boyer
2009-03-23 16:56 ` Mathieu Desnoyers
2009-03-23 17:04 ` Josh Boyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090316.203705.218202510.davem@davemloft.net \
--to=davem@davemloft.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox