All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Jake Moilanen <moilanen@austin.ibm.com>
Cc: 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 10:49:36 -0500	[thread overview]
Message-ID: <1086968975.1885.11.camel@gaston> (raw)
In-Reply-To: <1086962704.3476.53.camel@dyn95394175.austin.ibm.com>


> 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

Ben.



  reply	other threads:[~2004-06-11 15:52 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 [this message]
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

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=1086968975.1885.11.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=jbglaw@lug-owl.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moilanen@austin.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.