mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liu, Chuansheng" <chuansheng.liu@intel.com>
Cc: "Wang, Xiaoming" <xiaoming.wang@intel.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lib/spinlock_debug: Tweak the loop time to fit different _delay()
Date: Wed, 30 Apr 2014 11:52:05 +0200	[thread overview]
Message-ID: <20140430095205.GF30445@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <27240C0AC20F114CBF8149A2696CBE4A01D053BC@SHSMSX101.ccr.corp.intel.com>

On Wed, Apr 30, 2014 at 09:30:55AM +0000, Liu, Chuansheng wrote:
> > From: Peter Zijlstra [mailto:peterz@infradead.org]
> > Sent: Wednesday, April 30, 2014 4:55 PM
> > To: Wang, Xiaoming
> > Cc: mingo@redhat.com; linux-kernel@vger.kernel.org; Liu, Chuansheng
> > Subject: Re: [PATCH] lib/spinlock_debug: Tweak the loop time to fit different
> > _delay()
> > 
> > On Wed, Apr 30, 2014 at 06:40:38PM -0400, Wang, Xiaoming wrote:
> > > loops_per_jiffy*Hz  is not always 1 second exactly
> > > it depends on the realization of _delay() .
> > > delay_tsc is used as _delay() in arch/x86/lib/delay.c
> > 
> > This just states delay() is broken. The primary response should be to
> > try and fix that, no?
> 
> 
> delay(1s_count) is accurate, but delay(1) is not accurate indeed, since executing
> some instruction, then the 1 cycle delay maybe be used already.

OK, so there's (finally) a problem statement, so is there anything sane
we can do about that?

But yes, a trylock is a cmpxchg, and a cmpxchg on a contended cacheline
can be _much_ longer than one loop.

Now the real problem is coming up with something that'll work for all
architectures.

      reply	other threads:[~2014-04-30  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 22:40 Wang, Xiaoming
2014-04-30  8:50 ` Peter Zijlstra
2014-04-30  8:55 ` Peter Zijlstra
2014-04-30  9:30   ` Liu, Chuansheng
2014-04-30  9:52     ` Peter Zijlstra [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=20140430095205.GF30445@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=chuansheng.liu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=xiaoming.wang@intel.com \
    /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®