-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARC64]: Implement atomic backoff.
When the cpu count is high and contention hits an atomic object, the processors can synchronize such that some cpus continually get knocked out and cannot complete the atomic update. So implement an exponential backoff when SMP. Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
David S. Miller
committed
Oct 17, 2007
1 parent
d85714d
commit 24f287e
Showing
3 changed files
with
76 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef _SPARC64_BACKOFF_H | ||
#define _SPARC64_BACKOFF_H | ||
|
||
#define BACKOFF_LIMIT (4 * 1024) | ||
|
||
#ifdef CONFIG_SMP | ||
|
||
#define BACKOFF_SETUP(reg) \ | ||
mov 1, reg | ||
|
||
#define BACKOFF_SPIN(reg, tmp, label) \ | ||
mov reg, tmp; \ | ||
88: brnz,pt tmp, 88b; \ | ||
sub tmp, 1, tmp; \ | ||
cmp reg, BACKOFF_LIMIT; \ | ||
bg,pn %xcc, label; \ | ||
nop; \ | ||
ba,pt %xcc, label; \ | ||
sllx reg, 1, reg; | ||
|
||
#else | ||
|
||
#define BACKOFF_SETUP(reg) | ||
#define BACKOFF_SPIN(reg, tmp, label) | ||
|
||
#endif | ||
|
||
#endif /* _SPARC64_BACKOFF_H */ |