All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] __get_user/__put_user
Date: Thu, 09 May 2013 21:20:33 +0200	[thread overview]
Message-ID: <518BF701.6010807@web.de> (raw)
In-Reply-To: <518BF5F7.5070205@xenomai.org>

On 2013-05-09 21:16, Gilles Chanteperdrix wrote:
>>>> But why do we need to hold the nklock across the __rt_bind_helper in
>>>> __rt_queue_bind at all? Other binding services apparently don't have
>>>> this need.
>>>
>>>
>>> I suppose because we do not want the heap vanishing under our feet while
>>> we access its contents with the xnheap_* accessors.
>>
>> Right, but the general pattern for this is
>>
>> 	obj = xnregistry_fetch(handle)
>> 	get_nklock()
>> 	if (valid(obj))
>> 		do_something_with(obj)
>> 	put_nklock()
> 
> 
> Seems rather to be get_nklock before xnregistry_fetch.
> 

Only during heap and queue binding. All other native skin syscall
entries fetch from the registry without holding nklock. I suppose the
philosophy is that, if user space generates a race around picking up an
object and destroying / recreating a different one under the same name,
it will get what it deserves.

Jan


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20130509/3834e7d7/attachment.pgp>

  reply	other threads:[~2013-05-09 19:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16 20:19 [Xenomai] __get_user/__put_user Gilles Chanteperdrix
2013-03-16 20:25 ` Jan Kiszka
2013-03-16 20:27   ` Gilles Chanteperdrix
2013-03-16 20:28     ` Jan Kiszka
2013-03-16 20:50       ` Gilles Chanteperdrix
2013-05-09 17:32         ` Gilles Chanteperdrix
2013-05-09 17:58           ` Jan Kiszka
2013-05-09 18:02             ` Gilles Chanteperdrix
2013-05-09 18:02               ` Jan Kiszka
2013-05-09 18:03                 ` Gilles Chanteperdrix
2013-05-09 18:11                   ` Jan Kiszka
2013-05-09 18:27                     ` Gilles Chanteperdrix
2013-05-09 18:34                       ` Jan Kiszka
2013-05-09 18:36                         ` Gilles Chanteperdrix
2013-05-09 18:41                           ` Jan Kiszka
2013-05-09 19:08                             ` Gilles Chanteperdrix
2013-05-09 19:23                               ` Jan Kiszka
2013-05-09 19:16                             ` Gilles Chanteperdrix
2013-05-09 19:20                               ` Jan Kiszka [this message]
2013-05-09 19:20                               ` Philippe Gerum
2013-05-09 19:29                                 ` Jan Kiszka
2013-05-10 13:16                                 ` Gilles Chanteperdrix
2013-05-10 13:20                                   ` 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=518BF701.6010807@web.de \
    --to=jan.kiszka@web.de \
    --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.