All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH 2/9] Switch to handle-based fast mutex owners
Date: Mon, 01 Sep 2008 16:00:58 +0200	[thread overview]
Message-ID: <48BBF59A.6060208@domain.hid> (raw)
In-Reply-To: <48BBF299.7060205@domain.hid>

Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> To improve robustness of the fast mutex implementation in POSIX (and
>>> later on in native), it is better to track the mutex owner by handle
>>> instead of kernel object pointer. Therefore, this patch changes
>>> __xn_sys_current (xeno_set_current) so that it returns
>>> xnthread_handle(current_thread). It furthermore converts the POSIX mutex
>>> implementation to pick up and store the lock owner as handle in the
>>> kernel/user-shared mutex. Finally it ensures that all skins (except for
>>> RTDM which must not mess around with foreign skins anyway) add their
>>> threads to the registry so that at least anonymous handles are
>>> available.
>>>
>>> As the value stored in the mutex variable is now an integer, we can
>>> switch over to xnarch_atomic_t, removing all atomic_intptr users.
>> The current implementation allows RTDM threads to use POSIX skin
>> mutexes. I do not see why this should change.
> 
> Such mixup might technically be possible now. But there is neither a
> need nor does it make the resulting driver more portable. I don't want
> to introduce needless thread registration to RTDM just to cover
> theoretical use cases that should not exist in the first place.
> 
> Nevertheless, some sanity check will have to be added to the
> to-be-written generic xnsynch support to catch missing thread handles.
> That make sense for checking future skin implementation as well.

That is overhead in the hot path, whereas adding the thread registration
takes place in a non hot path.

-- 
                                                 Gilles.


  reply	other threads:[~2008-09-01 14:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  8:53 [Xenomai-core] [PATCH 0/9] Fast mutex rework, native support Jan Kiszka
2008-09-01  8:39 ` [Xenomai-core] [PATCH 1/9] Always register threads by their base Jan Kiszka
2008-09-01  8:44 ` [Xenomai-core] [PATCH 2/9] Switch to handle-based fast mutex owners Jan Kiszka
2008-09-01 11:58   ` Gilles Chanteperdrix
2008-09-01 13:48     ` Jan Kiszka
2008-09-01 14:00       ` Gilles Chanteperdrix [this message]
2008-09-01 14:03         ` Jan Kiszka
2008-09-01 14:08           ` Jan Kiszka
2008-09-02 12:31           ` Gilles Chanteperdrix
2008-09-05  8:34   ` [Xenomai-core] [PATCH 2/9] Switch to handle-based fast mutex owners - v2 Jan Kiszka
2008-09-05  9:40     ` Gilles Chanteperdrix
2008-09-05  9:46       ` Jan Kiszka
2008-09-05  9:50         ` Gilles Chanteperdrix
2008-09-05  9:55           ` Jan Kiszka
2008-09-05  9:57             ` Gilles Chanteperdrix
2008-09-01  8:45 ` [Xenomai-core] [PATCH 3/9] Remove xnarch_atomic_intptr wrappers Jan Kiszka
2008-09-01  8:47 ` [Xenomai-core] [PATCH 4/9] Spread xeno_set_current Jan Kiszka
2008-09-01  8:54 ` [Xenomai-core] [RFC][PATCH 5/9] Allow lock stealing via pthread_mutex_trylock Jan Kiszka
2008-09-01  9:58   ` Gilles Chanteperdrix
2008-09-01  8:57 ` [Xenomai-core] [RFC][PATCH 6/9] Add XNSYNCH_FWDROB Jan Kiszka
2008-09-01 10:00   ` Gilles Chanteperdrix
2008-09-01  9:01 ` [Xenomai-core] [RFC][PATCH 8/9] Native support for fast mutexes Jan Kiszka
2008-09-05  8:36   ` [Xenomai-core] [RFC][PATCH 8/9] Native support for fast mutexes - v2 Jan Kiszka
2008-09-01  9:06 ` [Xenomai-core] [RFC][PATCH 9/9] Optimize xnsynch_sleep_on for XN_NONBLOCK Jan Kiszka
2008-09-01  9:12 ` [Xenomai-core] [RFC][PATCH 7/9] Switch POSIX mutexes to XNSYNCH_FWDROB Jan Kiszka
2008-09-01 10:01   ` Gilles Chanteperdrix

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=48BBF59A.6060208@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@domain.hid \
    --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.