public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: moilanen@austin.ibm.com
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Jan-Benedict Glaw <jbglaw@lug-owl.de>
Subject: Re: [PATCH][RFC] Spinlock-timeout
Date: Fri, 11 Jun 2004 17:08:38 -0500	[thread overview]
Message-ID: <1086991717.2712.25.camel@gaston> (raw)
In-Reply-To: <Pine.A41.4.44.0406111613060.68840-100000@forte.austin.ibm.com>

On Fri, 2004-06-11 at 16:19, moilanen@austin.ibm.com wrote:
> > > Here's a revision to the patch that uses a HAVE_ARCH_GET_TB to allow
> > > archs use their timebases if they have one, and if they don't, it uses
> > > jiffies.  time_after_eq() is used to do the jiffy checking.
> > >
> > > I also left all of the arch/*/Kconfig changes in until a debug Kconfig
> > > is done.  I pretty much added in the spinlock timeout on all archs that
> > > have CONFIG_DEBUG_SPINLOCK.  If I missed your arch, I'm sorry.
> >
> > Nah, that's not how the abstraction should be done. Much simpler in
> > fact. Just do something like this in the generic code:
> >
> > #ifndef ARCH_HAS_SPINLOCK_TIMEOUT
> > #define get_spinlock_timeout() (jiffies + (SPINLOCK_TIMEOUT * HZ))
> > #define check_spinlock_timeout(timeout) (time_after_eq(jiffies, timeout))
> > #endif
> >
> > That's all. Then, any arch who has it's own implementation of these 2
> > function will #define ARCH_HAS_SPINLOCK_TIMEOUT and implement them the
> > way it wants. We shouldn't let anything like get_tb() slip into a common
> > file, it's totally PPC specific. Other archs may have different counters
> > they can use to impement the same thing. That part should be entirely
> > self contained in asm-xxx
> 
> That's much better.  Here's hopefully a version that could be merged.

Hehe, almost ;) There's a bit of non-unified diff at the end ...

Ben.



  reply	other threads:[~2004-06-11 22:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-05 20:31 [PATCH][RFC] Spinlock-timeout 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 [this message]
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

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=1086991717.2712.25.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=jbglaw@lug-owl.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moilanen@austin.ibm.com \
    --cc=paulus@samba.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