From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] [PATCH 08/12] Use fast xnsynch with native skin
Date: Fri, 17 Oct 2008 13:11:42 +0200 [thread overview]
Message-ID: <48F872EE.4050206@domain.hid> (raw)
In-Reply-To: <48F86FED.2010409@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> Jan Kiszka wrote:
>>>> Gilles Chanteperdrix wrote:
>>>>> Jan Kiszka wrote:
>>>>>
>>>>> Same remark for the #ifdefs.
>>>> Yes, but most cases (maybe except for owner checking) are unavoidable
>>>> due to heavy differences. I hope that we may have only FASTXNSYCH archs
>>>> one day.
>>>>
>>>>> I also do not understand your modification
>>>>> of rt_cond_wait_inner, this code is very tense; posix and native had the
>>>>> same bug in this area at different times, so this change should probably
>>>>> be made separately.
>>>> Which modification precisely (damn, I need to find out what makes quilt
>>>> cause this attachment confusion)? Note that lockcnt tracking changed
>>>> with this patch: the lock owner himself is in charge of maintaining it,
>>>> not some thread handing the lock over.
>>>>
>>>> That said, I would happily analyse the case that broke before. I will
>>>> also check if I can break out the lockcnt maintenance change, but I
>>>> think to recall that it was coupled to the fast path changes.
>>> The point is that in case of rt_cond_wait, the mutex must unlock
>>> completely regardless of the current lock count. So, the count is set to
>>> 1 before calling the function which unlocks the last level of the
>>> recursion count. As far as I can see, you removed the part which sets
>>> the counter to 1.
>>>
>> Don't find that spot. Are we talking about this change or something else?
>>
>>> --- a/ksrc/skins/native/cond.c
>>> +++ b/ksrc/skins/native/cond.c
>>> @@ -407,24 +407,26 @@ int rt_cond_wait_inner(RT_COND *cond, RT
>> ...
>>> mutex->lockcnt = 0;
>>>
>>> - if (xnsynch_release(&mutex->synch_base)) {
>>> - mutex->lockcnt = 1;
>>> - /* Scheduling deferred */
>>> - }
>>> + xnsynch_release(&mutex->synch_base);
>>> + /* Scheduling deferred */
>>>
>>> xnsynch_sleep_on(&cond->synch_base, timeout, timeout_mode);
>>>
>> In case it's the above: That setting of lockcnt is actually on behalf of
>> the new owner (xnsynch_release != NULL => we woke up a new owner). And
>> that has been sanitized in the patch in so far that only the owner
>> manipulates lockcnt, always. If you see a remaining issue in this
>> approach or find a hole in the implementation, please let me know.
>
> Who sets the lockcnt to 0 if there is no next owner ?
Look up, only a few lines...
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2008-10-17 11:11 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-16 15:46 [Xenomai-core] [PATCH 00/12] Generic fast xnsynch support & more Jan Kiszka
2008-10-16 15:46 ` [Xenomai-core] [PATCH 01/12] Generic thread registration Jan Kiszka
2008-10-16 19:26 ` Gilles Chanteperdrix
2008-10-16 21:55 ` Jan Kiszka
2008-10-16 15:46 ` [Xenomai-core] [PATCH 02/12] Handle-based xeno_get_current service Jan Kiszka
2008-10-16 19:36 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 03/12] Remove xnarch_atomic_intptr Jan Kiszka
2008-10-16 19:37 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 04/12] Spread xeno_set_current under all skins Jan Kiszka
2008-10-16 19:38 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 05/12] Factor out xnsynch_acquire/release Jan Kiszka
2008-10-16 19:46 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 06/12] Lockless fast path for xnsynch_acquire/release Jan Kiszka
2008-10-16 19:57 ` Gilles Chanteperdrix
2008-10-16 21:55 ` Jan Kiszka
2008-10-16 21:58 ` Gilles Chanteperdrix
2008-10-16 22:07 ` Jan Kiszka
2008-10-16 22:12 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 07/12] Convert POSIX skin to fast xnsynch Jan Kiszka
2008-10-16 20:05 ` Gilles Chanteperdrix
2008-10-16 21:56 ` Jan Kiszka
2008-10-16 15:46 ` [Xenomai-core] [PATCH 08/12] Use fast xnsynch with native skin Jan Kiszka
2008-10-16 20:13 ` Gilles Chanteperdrix
2008-10-16 22:53 ` Jan Kiszka
2008-10-17 9:07 ` Gilles Chanteperdrix
2008-10-17 10:56 ` Jan Kiszka
2008-10-17 10:58 ` Gilles Chanteperdrix
2008-10-17 11:11 ` Jan Kiszka [this message]
2008-10-17 11:14 ` Gilles Chanteperdrix
2008-10-17 11:21 ` Jan Kiszka
2008-10-17 11:37 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 09/12] Optionally replace pthread_getspecific with TLS variables Jan Kiszka
2008-10-16 20:18 ` Gilles Chanteperdrix
2008-10-16 22:26 ` Jan Kiszka
2008-10-17 15:02 ` Jan Kiszka
2008-10-16 15:46 ` [Xenomai-core] [PATCH 10/12] Report current shadow thread mode to user space Jan Kiszka
2008-10-16 20:23 ` Gilles Chanteperdrix
2008-10-16 23:10 ` Jan Kiszka
2008-10-17 7:32 ` Jan Kiszka
2008-10-16 15:46 ` [Xenomai-core] [PATCH 11/12] Ensure mode switch in mutex fast paths Jan Kiszka
2008-10-16 20:27 ` Gilles Chanteperdrix
2008-10-16 15:46 ` [Xenomai-core] [PATCH 12/12] Enable SMP support for user libs by default Jan Kiszka
2008-10-16 20:29 ` Gilles Chanteperdrix
2008-10-16 22:14 ` Jan Kiszka
2008-10-16 16:21 ` [Xenomai-core] [PATCH 00/12] Generic fast xnsynch support & more Gilles Chanteperdrix
2008-10-17 12:28 ` Gilles Chanteperdrix
2008-10-17 12:44 ` Jan Kiszka
2008-10-17 12:51 ` Gilles Chanteperdrix
2008-10-17 13:31 ` Jan Kiszka
2008-10-17 13:36 ` 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=48F872EE.4050206@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=gilles.chanteperdrix@xenomai.org \
--cc=xenomai@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.