From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: adeos-main <adeos-main@gna.org>
Subject: Re: [Adeos-main] Deadlock-prone ipipe_critical_enter
Date: Tue, 17 Aug 2010 13:34:40 +0200 [thread overview]
Message-ID: <4C6A73D0.3040401@domain.hid> (raw)
In-Reply-To: <4C6A70D7.4040306@domain.hid>
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Hi,
>>
>> it turned out ipipe_critical_enter is broken on SMP > 2 CPUs: On one
>> CPU, Linux may have acquired an rwlock for reading when being preempted
>> by the critical IPI. On some other CPU, Linux may have entered
>> write_lock_irq[save] before the IPI arrived. The reader will be stuck in
>> __ipipe_do_critical_sync, the writer in __write_lock_failed - forever.
>> First seen on real silicon (once per "few" hundreds of boots), finally
>> caught under KVM and nailed down.
>>
>> Two approaches to resolve this issue come to my mind so far. The first
>> one is to restart the whole ipipe_critical_enter after some (how many?)
>> cycles of futile waiting. The other is to accept the critical IPI even
>> if the top-most domain is stalled (as it sits in write_lock_irq), but
>> I'm not 100% that our optimistic IRQ mask will always allow this when
>> Linux is on the top (I assume we can safely require other domains to
>> avoid such deadlocks by design).
>>
>> Comments? Better ideas?
>
> I guess, the rwlocks are ipipe rwlocks, right?
Nope, plain Linux tasklist_lock. No Xenomai domain active at this point,
just Linux.
> I am not sure it is different from your second idea, but what about
> spinning in write_lock_irq/save with irqs on?
Hard-IRQs on (which is what my second idea would rely on) or Linux IRQs
on (which would involve patching Linux spinlock arch code and may have
side effects)?
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2010-08-17 11:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 11:17 [Adeos-main] Deadlock-prone ipipe_critical_enter Jan Kiszka
2010-08-17 11:21 ` Gilles Chanteperdrix
2010-08-17 11:34 ` Jan Kiszka [this message]
2010-08-17 11:36 ` Gilles Chanteperdrix
2010-08-17 11:41 ` Jan Kiszka
2010-08-17 15:33 ` Philippe Gerum
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=4C6A73D0.3040401@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=adeos-main@gna.org \
--cc=gilles.chanteperdrix@xenomai.org \
/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.