From: Jake Moilanen <moilanen@austin.ibm.com>
To: Linux Kernel list <linux-kernel@vger.kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Jan-Benedict Glaw <jbglaw@lug-owl.de>
Subject: Re: [PATCH][RFC] Spinlock-timeout
Date: Fri, 11 Jun 2004 09:08:22 -0500 [thread overview]
Message-ID: <1086962902.3476.58.camel@dyn95394175.austin.ibm.com> (raw)
In-Reply-To: <1086560618.10538.32.camel@gaston>
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
On Sun, 2004-06-06 at 17:23, Benjamin Herrenschmidt wrote:
> On Sat, 2004-06-05 at 15:31, Jake Moilanen wrote:
> > Here's a patch that will BUG() when a spinlock is held for longer then X
> > seconds. It is useful for catching deadlocks since not all archs have a
> > NMI watchdog.
> >
> > It is also helpful to find locks that are held too long.
> >
> > Please send comments.
>
> It would be better to use the timebase on CPUs that have one, no ? Or
> you'll miss cases where either irqs are disabled or you are on a code
> path issued by the timer interrupt, and thus jiffies isn't updated
Here is the ppc64 add-on for the HAVE_ARCH_GET_TB.
Thanks,
Jake
[-- Attachment #2: spinlock-timeout-2.6-v2-ppc64.patch --]
[-- Type: text/x-patch, Size: 2750 bytes --]
===== arch/ppc64/kernel/chrp_setup.c 1.47 vs edited =====
*** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_chrp_setup.c-1.47_T8bKaF 2004-04-27 05:07:31 +00:00
--- arch/ppc64/kernel/chrp_setup.c 2004-06-09 16:38:23 +00:00
*************** chrp_progress(char *s, unsigned short he
*** 405,414 ****
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;
--- 405,410 ----
===== arch/ppc64/kernel/time.c 1.30 vs edited =====
*** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_time.c-1.30_TupeZw 2004-05-31 17:41:03 +00:00
--- arch/ppc64/kernel/time.c 2004-06-09 16:38:24 +00:00
*************** static unsigned long first_settimeofday
*** 81,87 ****
#define XSEC_PER_SEC (1024*1024)
! unsigned long tb_ticks_per_jiffy;
unsigned long tb_ticks_per_usec;
unsigned long tb_ticks_per_sec;
unsigned long next_xtime_sync_tb;
--- 81,87 ----
#define XSEC_PER_SEC (1024*1024)
! 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;
===== include/asm-ppc64/eeh.h 1.10 vs edited =====
*** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_eeh.h-1.10_XhZlsA 2004-06-01 09:27:13 +00:00
--- include/asm-ppc64/eeh.h 2004-06-09 16:38:28 +00:00
***************
*** 24,29 ****
--- 24,30 ----
#include <linux/init.h>
struct pci_dev;
+ struct device_node;
/* I/O addresses are converted to EEH "tokens" such that a driver will cause
* a bad page fault if the address is used directly (i.e. these addresses are
===== include/asm-ppc64/processor.h 1.45 vs edited =====
*** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_processor.h-1.45_nCcpY2 2004-06-01 09:27:47 +00:00
--- include/asm-ppc64/processor.h 2004-06-09 16:38:28 +00:00
*************** GLUE(.,name):
*** 440,445 ****
--- 440,448 ----
#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 */
===== include/asm-ppc64/time.h 1.7 vs edited =====
*** /home/moilanen/sbx/linux-2.6/BitKeeper/tmp/bk_time.h-1.7_ZyJHwv 2002-06-10 02:37:26 +00:00
--- include/asm-ppc64/time.h 2004-06-09 16:38:28 +00:00
***************
*** 20,26 ****
--- 20,30 ----
#include <asm/processor.h>
#include <asm/paca.h>
+ #ifdef CONFIG_PPC_ISERIES
#include <asm/iSeries/HvCall.h>
+ #endif
+
+ #define HAVE_ARCH_GET_TB
/* time.c */
extern unsigned long tb_ticks_per_jiffy;
prev parent reply other threads:[~2004-06-11 14:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-05 20:31 Jake Moilanen
2004-06-05 20:51 ` Jan-Benedict Glaw
2004-06-10 18:44 ` Jake Moilanen
2004-06-10 19:24 ` Jan-Benedict Glaw
2004-06-10 21:00 ` Randy.Dunlap
2004-06-06 10:13 ` Paul Mackerras
2004-06-06 22:23 ` Benjamin Herrenschmidt
2004-06-11 14:05 ` Jake Moilanen
2004-06-11 15:49 ` Benjamin Herrenschmidt
2004-06-11 21:19 ` moilanen
2004-06-11 22:08 ` Benjamin Herrenschmidt
2004-06-14 13:12 ` Jake Moilanen
2004-06-11 21:22 ` moilanen
2004-06-11 22:09 ` Benjamin Herrenschmidt
2004-06-14 13:13 ` Jake Moilanen
2004-06-11 14:08 ` Jake Moilanen [this message]
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=1086962902.3476.58.camel@dyn95394175.austin.ibm.com \
--to=moilanen@austin.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=jbglaw@lug-owl.de \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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®