From: Jake Moilanen <moilanen@austin.ibm.com>
To: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] Spinlock timeout ppc64 addon
Date: Tue, 6 Jul 2004 16:16:41 -0500 [thread overview]
Message-ID: <20040706161641.2e66d63c.moilanen@austin.ibm.com> (raw)
Here's the PPC64 add-on to spinlock timeouts.
Please comment or apply.
Thanks,
Jake
Signed-off-by: Jake Moilanen <moilanen@austin.ibm.com>
---
diff -puN arch/ppc64/kernel/chrp_setup.c~spinlock-timeout-ppc64 arch/ppc64/kernel/chrp_setup.c
--- linux-2.6/arch/ppc64/kernel/chrp_setup.c~spinlock-timeout-ppc64 Tue Jul 6 15:18:16 2004
+++ linux-2.6-moilanen/arch/ppc64/kernel/chrp_setup.c Tue Jul 6 15:18:16 2004
@@ -405,10 +405,6 @@ chrp_progress(char *s, unsigned short he
extern void setup_default_decr(void);
-/* Some sane defaults: 125 MHz timebase, 1GHz processor */
-#define DEFAULT_TB_FREQ 125000000UL
-#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
-
void __init pSeries_calibrate_decr(void)
{
struct device_node *cpu;
diff -puN arch/ppc64/kernel/time.c~spinlock-timeout-ppc64 arch/ppc64/kernel/time.c
--- linux-2.6/arch/ppc64/kernel/time.c~spinlock-timeout-ppc64 Tue Jul 6 15:18:16 2004
+++ linux-2.6-moilanen/arch/ppc64/kernel/time.c Tue Jul 6 15:18:16 2004
@@ -81,7 +81,7 @@ static unsigned long first_settimeofday
#define XSEC_PER_SEC (1024*1024)
-unsigned long tb_ticks_per_jiffy;
+unsigned long tb_ticks_per_jiffy = DEFAULT_TB_FREQ / HZ;
unsigned long tb_ticks_per_usec;
unsigned long tb_ticks_per_sec;
unsigned long next_xtime_sync_tb;
diff -puN include/asm-ppc64/processor.h~spinlock-timeout-ppc64 include/asm-ppc64/processor.h
--- linux-2.6/include/asm-ppc64/processor.h~spinlock-timeout-ppc64 Tue Jul 6 15:18:16 2004
+++ linux-2.6-moilanen/include/asm-ppc64/processor.h Tue Jul 6 15:18:16 2004
@@ -438,6 +438,9 @@ GLUE(.,name):
#endif /* __ASSEMBLY__ */
+/* Some sane defaults: 125 MHz timebase, 1GHz processor */
+#define DEFAULT_TB_FREQ 125000000UL
+#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
/* Macros for setting and retrieving special purpose registers */
diff -puN include/asm-ppc64/spinlock.h~spinlock-timeout-ppc64 include/asm-ppc64/spinlock.h
--- linux-2.6/include/asm-ppc64/spinlock.h~spinlock-timeout-ppc64 Tue Jul 6 15:18:16 2004
+++ linux-2.6-moilanen/include/asm-ppc64/spinlock.h Tue Jul 6 15:18:16 2004
@@ -216,5 +216,16 @@ static __inline__ int is_write_locked(rw
#define rwlock_is_locked(x) ((x)->lock)
+#ifdef CONFIG_SPINLOCK_TIMEOUT
+
+#define ARCH_HAS_SPINLOCK_TIMEOUT
+
+extern unsigned long tb_ticks_per_jiffy;
+
+#define get_spinlock_timeout() (mftb() + (tb_ticks_per_jiffy * SPINLOCK_TIMEOUT * HZ))
+#define check_spinlock_timeout(timeout) (mftb() >= timeout ? 1 : 0)
+
+#endif /* CONFIG_SPINLOCK_TIMEOUT */
+
#endif /* __KERNEL__ */
#endif /* __ASM_SPINLOCK_H */
_
reply other threads:[~2004-07-06 21:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20040706161641.2e66d63c.moilanen@austin.ibm.com \
--to=moilanen@austin.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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
all inboxes | Powered by JetHome®