All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Tesarik <ptesarik@suse.cz>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Hedi Berriche <hedi@sgi.com>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Serious problem with ticket spinlocks on ia64
Date: Mon, 30 Aug 2010 21:41:13 +0000	[thread overview]
Message-ID: <201008302341.14312.ptesarik@suse.cz> (raw)
In-Reply-To: <987664A83D2D224EAE907B061CE93D53015D9B14DC@orsmsx505.amr.corp.intel.com>

On Monday 30 of August 2010 20:17:25 Luck, Tony wrote:
> > I may tinker with this test a bit to include some short random
> > amounts of hold-time for the lock, and delays between attempts
> > to acquire it (to make it look more like a contended kernel lock
> > and less like a continuous queue of processes trading around a
> > lock that is never free
>
> I've been iterating ... adding new bits to try to reproduce the
> kernel environment:

Hi Tony,

I've been also playing with my test case, and I haven't been able to reproduce 
it in user-space either. One thing I noticed was the apparently incorrect use 
of ALAT. The generated code for _spin_lock_irq contains:

invala;;
ld4.c.nc r11=[r32]
// Other instructions not affecting r20
ld4.c.nc r20=[r32]

IIUC, the subsequent compare can use an undefined value (r20 is not modified 
anywhere in this function, except by the ld4.c.nc, but that happens only on 
an ALAT miss, right?).

I changed the corresponding code in __ticket_spin_lock to:

   asm volatile ("ld4.c.nc %0=[%1]" : "+r"(serve) : "r"(p) : "memory");

(NB the "+r" constraint instead of "=r")

The generated code now re-uses r15. Unfortunately, Hedi's test case still 
fails for me. :(

Petr Tesarik

WARNING: multiple messages have this Message-ID (diff)
From: Petr Tesarik <ptesarik@suse.cz>
To: "Luck, Tony" <tony.luck@intel.com>
Cc: Hedi Berriche <hedi@sgi.com>,
	"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Serious problem with ticket spinlocks on ia64
Date: Mon, 30 Aug 2010 23:41:13 +0200	[thread overview]
Message-ID: <201008302341.14312.ptesarik@suse.cz> (raw)
In-Reply-To: <987664A83D2D224EAE907B061CE93D53015D9B14DC@orsmsx505.amr.corp.intel.com>

On Monday 30 of August 2010 20:17:25 Luck, Tony wrote:
> > I may tinker with this test a bit to include some short random
> > amounts of hold-time for the lock, and delays between attempts
> > to acquire it (to make it look more like a contended kernel lock
> > and less like a continuous queue of processes trading around a
> > lock that is never free
>
> I've been iterating ... adding new bits to try to reproduce the
> kernel environment:

Hi Tony,

I've been also playing with my test case, and I haven't been able to reproduce 
it in user-space either. One thing I noticed was the apparently incorrect use 
of ALAT. The generated code for _spin_lock_irq contains:

invala;;
ld4.c.nc r11=[r32]
// Other instructions not affecting r20
ld4.c.nc r20=[r32]

IIUC, the subsequent compare can use an undefined value (r20 is not modified 
anywhere in this function, except by the ld4.c.nc, but that happens only on 
an ALAT miss, right?).

I changed the corresponding code in __ticket_spin_lock to:

   asm volatile ("ld4.c.nc %0=[%1]" : "+r"(serve) : "r"(p) : "memory");

(NB the "+r" constraint instead of "=r")

The generated code now re-uses r15. Unfortunately, Hedi's test case still 
fails for me. :(

Petr Tesarik

  reply	other threads:[~2010-08-30 21:41 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-27 13:37 Serious problem with ticket spinlocks on ia64 Petr Tesarik
2010-08-27 13:37 ` Petr Tesarik
2010-08-27 13:48 ` Hedi Berriche
2010-08-27 13:48   ` Hedi Berriche
2010-08-27 14:09   ` Petr Tesarik
2010-08-27 14:09     ` Petr Tesarik
2010-08-27 14:31     ` Hedi Berriche
2010-08-27 14:31       ` Hedi Berriche
2010-08-27 14:40       ` Petr Tesarik
2010-08-27 14:40         ` Petr Tesarik
2010-08-27 14:52         ` Hedi Berriche
2010-08-27 14:52           ` Hedi Berriche
2010-08-27 16:37           ` Petr Tesarik
2010-08-27 16:37             ` Petr Tesarik
2010-08-27 16:08 ` Luck, Tony
2010-08-27 16:08   ` Luck, Tony
2010-08-27 17:16   ` Petr Tesarik
2010-08-27 17:16     ` Petr Tesarik
2010-08-27 18:20     ` Hedi Berriche
2010-08-27 18:20       ` Hedi Berriche
2010-08-27 19:40     ` Petr Tesarik
2010-08-27 19:40       ` Petr Tesarik
2010-08-27 20:29   ` Luck, Tony
2010-08-27 20:29     ` Luck, Tony
2010-08-27 20:41     ` Petr Tesarik
2010-08-27 20:41       ` Petr Tesarik
2010-08-27 21:03     ` Petr Tesarik
2010-08-27 21:03       ` Petr Tesarik
2010-08-27 21:11       ` Luck, Tony
2010-08-27 21:11         ` Luck, Tony
2010-08-27 22:13         ` Petr Tesarik
2010-08-27 22:13           ` Petr Tesarik
2010-08-27 23:26           ` Luck, Tony
2010-08-27 23:26             ` Luck, Tony
2010-08-27 23:55             ` Luck, Tony
2010-08-27 23:55               ` Luck, Tony
2010-08-28  0:28               ` Hedi Berriche
2010-08-28  0:28                 ` Hedi Berriche
2010-08-28  5:01                 ` Luck, Tony
2010-08-28  5:01                   ` Luck, Tony
2010-08-30 18:17                   ` Luck, Tony
2010-08-30 18:17                     ` Luck, Tony
2010-08-30 21:41                     ` Petr Tesarik [this message]
2010-08-30 21:41                       ` Petr Tesarik
2010-08-30 22:43                       ` Tony Luck
2010-08-30 22:43                         ` Tony Luck
2010-08-31 22:17                         ` Tony Luck
2010-08-31 22:17                           ` Tony Luck
2010-09-01 23:09                           ` Tony Luck
2010-09-01 23:09                             ` Tony Luck
2010-09-02  0:26                             ` Hedi Berriche
2010-09-02  0:26                               ` Hedi Berriche
2010-09-03  0:06                               ` Tony Luck
2010-09-03  0:06                                 ` Tony Luck
2010-09-03  9:04                                 ` Petr Tesarik
2010-09-03  9:04                                   ` Petr Tesarik
2010-09-03 14:35                                   ` Petr Tesarik
2010-09-03 14:35                                     ` Petr Tesarik
2010-09-03 14:52                                     ` Petr Tesarik
2010-09-03 14:52                                       ` Petr Tesarik
2010-09-03 15:50                                       ` Tony Luck
2010-09-03 15:50                                         ` Tony Luck
2010-09-06 14:47                                         ` Petr Tesarik
2010-09-06 14:47                                           ` Petr Tesarik
2010-09-07 13:17                                           ` Petr Tesarik
2010-09-07 13:17                                             ` Petr Tesarik
2010-09-07 17:35                                             ` Tony Luck
2010-09-07 17:35                                               ` Tony Luck
2010-09-08 15:55                                               ` Tony Luck
2010-09-08 15:55                                                 ` Tony Luck
2010-09-10  2:55                                     ` Dave Jones
2010-09-10  2:55                                       ` Dave Jones

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=201008302341.14312.ptesarik@suse.cz \
    --to=ptesarik@suse.cz \
    --cc=hedi@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@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 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.