All of lore.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5
@ 2001-06-27 18:20 Bill Nottingham
  2001-06-27 18:29 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux Robboy, David G
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bill Nottingham @ 2001-06-27 18:20 UTC (permalink / raw)
  To: linux-ia64

Robboy, David G (david.g.robboy@intel.com) said: 
> On a 4P Lion with Red Hat 7.0.98 installed and a 2.4.5 kernel, a 4P fft
> application sometimes hangs in a barrier.  All 4 threads get into the
> barrier and none get out because a count gets up to 3 and they are waiting
> for it to get to 4.

Stock 2.4.5 or something else?

Bill


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux
  2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
@ 2001-06-27 18:29 ` Robboy, David G
  2001-06-27 21:57 ` Robboy, David G
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Robboy, David G @ 2001-06-27 18:29 UTC (permalink / raw)
  To: linux-ia64

> Stock 2.4.5 or something else?

Something else.  We have features of our own in the kernel for system
validation.  I guess I should try it on a stock kernel.

David



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux
  2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
  2001-06-27 18:29 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux Robboy, David G
@ 2001-06-27 21:57 ` Robboy, David G
  2001-06-28  0:18 ` Luck, Tony
  2001-06-28  7:39 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Jose Luu
  3 siblings, 0 replies; 5+ messages in thread
From: Robboy, David G @ 2001-06-27 21:57 UTC (permalink / raw)
  To: linux-ia64

The problem I previously reported occurs on a 2.4.5 kernel built from stock
source code (No Alan Cox patches, only the ia64 patch).

I slightly misstated the problem.  Here is what actually happens:
Four threads have entered a barrier (my own C code).  Within the barrier,
they call pthread_mutex_lock and increment a counter while holding the lock.
Three threads are waiting on the counter, whose value is three, to go to
four.  The fourth CPU is looping in the kernel in cpu_idle.  I don't know
how it got there, but probably it has something to do with calling
pthread_mutex_lock.

As I said, if anyone wants to investigate this I will provide a test case.

David

> -----Original Message-----
> From: Robboy, David G [mailto:david.g.robboy@intel.com]
> Sent: Wednesday, June 27, 2001 11:30 AM
> To: 'Bill Nottingham'; 'linux-ia64@linuxia64.org'
> Subject: RE: [Linux-ia64] Re: pthread_mutex_lock sometimes fails on
> Linux 2.4.5
> 
> 
> > Stock 2.4.5 or something else?
> 
> Something else.  We have features of our own in the kernel for system
> validation.  I guess I should try it on a stock kernel.
> 
> David
> 
> 
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux
  2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
  2001-06-27 18:29 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux Robboy, David G
  2001-06-27 21:57 ` Robboy, David G
@ 2001-06-28  0:18 ` Luck, Tony
  2001-06-28  7:39 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Jose Luu
  3 siblings, 0 replies; 5+ messages in thread
From: Luck, Tony @ 2001-06-28  0:18 UTC (permalink / raw)
  To: linux-ia64

This sounds similar to a problem that I saw a few weeks
ago.  In my case threads would spin for an inordinate
amount of time in __pthread_lock() because re-reading of
the __status field was optimised out of the loop (it isn't
declared as volatile).  Newer versions of glibc (2.2.2 IIRC)
have some __asm() magic in the loop to force the re-read (the
glibc folks didn't want to make the __status field volatile
because of lots of other pointer casting changes that would
have been needed).

See if a newer glibc helps with your problem too.

-Tony Luck

-----Original Message-----
I slightly misstated the problem.  Here is what actually happens:
Four threads have entered a barrier (my own C code).  Within the barrier,
they call pthread_mutex_lock and increment a counter while holding the lock.
Three threads are waiting on the counter, whose value is three, to go to
four.  The fourth CPU is looping in the kernel in cpu_idle.  I don't know
how it got there, but probably it has something to do with calling
pthread_mutex_lock.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5
  2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
                   ` (2 preceding siblings ...)
  2001-06-28  0:18 ` Luck, Tony
@ 2001-06-28  7:39 ` Jose Luu
  3 siblings, 0 replies; 5+ messages in thread
From: Jose Luu @ 2001-06-28  7:39 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

> As I said, if anyone wants to investigate this I will provide a test case.
>
> David

I am seeing something similar in ia32 mode, in my case, this is not new (saw it since 2.4.1).

Could you send me your test case ? As it may help me to investigate.

Thanks
Jose


[-- Attachment #2: Type: text/html, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-06-28  7:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-27 18:20 [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Bill Nottingham
2001-06-27 18:29 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux Robboy, David G
2001-06-27 21:57 ` Robboy, David G
2001-06-28  0:18 ` Luck, Tony
2001-06-28  7:39 ` [Linux-ia64] Re: pthread_mutex_lock sometimes fails on Linux 2.4.5 Jose Luu

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.