* [PATCH -mm] likely_prof: update to test_and_set_bit_lock / clear_bit_unlock
@ 2008-04-04 11:27 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2008-04-04 11:27 UTC (permalink / raw)
To: Andrew Morton; +Cc: nickpiggin, lkml
Because the _lock routines are faster and provide a better example to follow.
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
As suggested by Nick Piggin. To be applied after Daniels likeliness patches
and my previous likeliness-accounting-change-and-cleanup.patch,
The patch was checkpatch.pl, compile, sparse and run tested (uml).
diff --git a/lib/likely_prof.c b/lib/likely_prof.c
index c9a8d1d..0da3181 100644
--- a/lib/likely_prof.c
+++ b/lib/likely_prof.c
@@ -36,7 +36,7 @@ int do_check_likely(struct likeliness *likeliness, unsigned int ret)
* disable and it was a bit cleaner then using internal __raw
* spinlock calls.
*/
- if (!test_and_set_bit(0, &likely_lock)) {
+ if (!test_and_set_bit_lock(0, &likely_lock)) {
if (likeliness->label & LP_UNSEEN) {
likeliness->label &= (~LP_UNSEEN);
likeliness->next = likeliness_head;
@@ -44,8 +44,7 @@ int do_check_likely(struct likeliness *likeliness, unsigned int ret)
likeliness->caller = (unsigned long)
__builtin_return_address(0);
}
- smp_mb__before_clear_bit();
- clear_bit(0, &likely_lock);
+ clear_bit_unlock(0, &likely_lock);
}
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-04-04 11:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-04 11:27 [PATCH -mm] likely_prof: update to test_and_set_bit_lock / clear_bit_unlock Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).