mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chuck Ebbert <76306.1226@compuserve.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, Dave Jones <davej@redhat.com>
Subject: Re: + spinlock_debug-dont-recompute-jiffies_per_loop.patch added to -mm tree
Date: Thu, 27 Jul 2006 01:53:55 -0400	[thread overview]
Message-ID: <200607270155_MC3-1-C637-8E28@compuserve.com> (raw)

In-Reply-To: <20060725204306.GA22547@elte.hu>

On Tue, 25 Jul 2006 22:43:06 +0200, Ingo Molnar wrote:
> 
> * Dave Jones <davej@redhat.com> wrote:
> 
> >  > iteration limit, gets recomputed every time.  Caching it explicitly 
> >  > prevents that.
> > 
> > What is the purpose of those __delays being there at all ? Seems odd 
> > to be waiting that long when the spinlock could become available a lot 
> > sooner.  (These also make spinlock debug really painful on boxes with 
> > huge numbers of CPUs).
> 
> the debug code has to figure out when to trigger a deadlock warning 
> message. If we are looping in a deadlock with irqs disabled on all CPUs, 
> there's nothing that advances jiffies. The TSC is not reliable. The 
> thing that remains is to use __delay(1). We could calibrate the loop 
> separately perhaps?

Is there some reason this code:

                for (i = 0; i < loops_per_jiffy * HZ; i++) {
                        if (__raw_spin_trylock(&lock->raw_lock))
                                return;
                        __delay(1);
                }

needs to continuously try to update the spinlock?  Shouldn't it just
read it first, like this, to avoid the bus update traffic?

                        if (spin_can_lock(&lock->raw_lock) &&
                            __raw_spin_trylock(&lock->raw_lock))
                                return;


Also, looking at __delay(), I foresee problems on i386 with the HPET timer.
Every call to __delay() causes at least two HPET timer reads and it looks
like they're slow (using readl() on ioremapped memory, anyway.)

-- 
Chuck


             reply	other threads:[~2006-07-27  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27  5:53 Chuck Ebbert [this message]
     [not found] <200607251910.k6PJASfo006168@shell0.pdx.osdl.net>
2006-07-25 20:42 ` Dave Jones
2006-07-25 20:43   ` Ingo Molnar

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=200607270155_MC3-1-C637-8E28@compuserve.com \
    --to=76306.1226@compuserve.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /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®