All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Enhanced RTDM device closure
Date: Wed, 21 Feb 2007 11:48:33 +0100	[thread overview]
Message-ID: <45DC2381.2020108@domain.hid> (raw)
In-Reply-To: <45DC1F14.4030300@domain.hid>

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

Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> I have to have a closer look at the code. But you are right, since the
>>> ppd cannot vanish under our feet, maybe is it possible to call
>>> xnshadow_ppd_get without holding the nklock at all. We "only" have to
>>> suppose that the lists manipulation routines will never set the list to
>>> an inconsistent state.
>>
>> As long as process A's ppd can take a place in the same list as process
>> B's one, you need locking (or RCU :-/). That's my point about the hash
>> chain approach.
>>
>> I can only advertise the idea again to maintain the ppd pointers as an
>> I-pipe task_struct key. On fork/clone, you just have to make sure that
>> the child either gets a copy of the parent's pointer when it will share
>> the mm, or its key is NULL'ified, or automatic Xenomai skin binding is
>> triggered to generate in a new ppd.
> 
> I agree with the idea of the ptd. Nevertheless, I think it is possible
> to access an xnqueue in a lockless fashion. Concurrent insertions and
> deletions only matter if they take place before (in list order) the
> target. When we are walking the list, only the "next" pointers matters.
> Now, if we look at the "next" pointers in the insertion routine, we see:
> 
>    holder->next = head->next;
>    head->next = holder;
> 
> So, maybe we just need to add a compiler barrier, but it looks like we
> can never see a wrong pointer when walking the list.
> 

But not having to walk some chain, even if it's lock-less then, can also
save us from potential cache misses on accessing those memory chunks... :)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2007-02-21 10:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21  8:43 [Xenomai-core] Enhanced RTDM device closure Jan Kiszka
2007-02-21  8:56 ` Gilles Chanteperdrix
2007-02-21  9:11   ` Jan Kiszka
2007-02-21  9:40     ` Gilles Chanteperdrix
2007-02-21  9:57       ` Jan Kiszka
2007-02-21 10:29         ` Gilles Chanteperdrix
2007-02-21 10:48           ` Jan Kiszka [this message]
2007-02-25 15:36 ` Jan Kiszka

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=45DC2381.2020108@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.