Re: PI BUG with -rt13

From: Dinakar Guniguntala
Date: Thu Nov 24 2005 - 15:21:06 EST


On Thu, Nov 24, 2005 at 03:57:34PM +0100, Ingo Molnar wrote:
>
> * david singleton <dsingleton@xxxxxxxxxx> wrote:
>
> > Sure. Attached is the locking fix patch. [...]
>
> thanks, applied - it should show up in -rt15.
>

I just noticed with the above fix, Paul's testcase completely
hangs up and when killed I hit the BUG mentioned below.
Till -rt13, this testcase just ran to completion

check_monotonic_clock: monotonic inconsistency detected!
from 52d314a423 (355728663587) to 50a53da892 (346369665170).
pthread_cond_ma/6345[CPU#2]: BUG in check_monotonic_clock at kernel/time/timeofday.c:156
[<c011a840>] __WARN_ON+0x60/0x80 (8)
[<c0139972>] check_monotonic_clock+0xcc/0x109 (48)
[<c0139dfe>] get_monotonic_clock+0x110/0x146 (68)
[<c013100c>] ktimer_interrupt+0x54/0x2f6 (92)
[<c010163c>] __switch_to+0x2a/0x248 (12)
[<c037d82b>] __schedule+0x41b/0xab7 (40)
[<c013b86e>] add_preempt_count_ti+0x1e/0xc6 (20)
[<c013b86e>] add_preempt_count_ti+0x1e/0xc6 (8)
[<c01393e4>] handle_nextevent_update+0xd/0x23 (20)
[<c010caaa>] smp_apic_timer_interrupt+0x5c/0x65 (12)
[<c01037a4>] apic_timer_interrupt+0x1c/0x24 (12)
[<c037f39f>] __down_mutex+0x69f/0x7fd (44)
[<c0122856>] lock_timer_base+0x19/0x33 (24)
[<c0122856>] lock_timer_base+0x19/0x33 (76)
[<c0122856>] lock_timer_base+0x19/0x33 (20)
[<c03815fd>] _spin_lock_irqsave+0x1d/0x46 (12)
[<c0122856>] lock_timer_base+0x19/0x33 (8)
[<c0122856>] lock_timer_base+0x19/0x33 (16)
[<c01228a8>] __mod_timer+0x38/0xdf (16)
[<c037e86e>] schedule_timeout+0x4f/0xa2 (32)
[<c0123773>] process_timeout+0x0/0x9 (32)
[<c013c95d>] futex_wait+0x225/0x2b5 (24)
[<c012e332>] add_wait_queue+0x12/0x30 (80)
[<c013b9cb>] sub_preempt_count+0x1a/0x1e (20)
[<c0381c34>] _raw_spin_unlock+0x12/0x2c (44)
[<c037db39>] __schedule+0x729/0xab7 (8)
[<c0114b4d>] default_wake_function+0x0/0x22 (12)
[<c0114b4d>] default_wake_function+0x0/0x22 (32)
[<c013d84f>] do_futex+0xf3/0xf8 (40)
[<c013d949>] sys_futex+0xf5/0x101 (40)
[<c013d951>] sys_futex+0xfd/0x101 (36)
[<c0102ce7>] sysenter_past_esp+0x54/0x75 (24)
---------------------------
| preempt count: 00010001 ]
| 1-level deep critical section nesting:
----------------------------------------
.. [<c013b930>] .... add_preempt_count+0x1a/0x1e
.....[<00000000>] .. ( <= stext+0x3feffd68/0x8)

------------------------------
| showing all locks held by: | (pthread_cond_ma/6345 [f2a52120, 0]):
------------------------------

#001: [c3888fe0] {&base->t_base.lock}
... acquired at: lock_timer_base+0x19/0x33


I have attached the testcase below. Run it as

gcc -g -lpthread pthread_cond_many.c -o pthread_cond_many
sh ./pthread_cond_many.sh --realtime


-Dinakar



Attachment: rt-pthread.tar.gz
Description: GNU Zip compressed data