All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: Xenomai@xenomai.org
Subject: Re: [Xenomai] Sharing memory between rt-posix and standard-posix apps
Date: Wed, 20 Jun 2012 11:18:28 +0200	[thread overview]
Message-ID: <4FE19564.6020502@xenomai.org> (raw)
In-Reply-To: <4FE17CD4.2060108@grandegger.com>

On 06/20/2012 09:33 AM, Wolfgang Grandegger wrote:
> On 06/19/2012 11:38 AM, Gilles Chanteperdrix wrote:
>> On 06/19/2012 11:29 AM, Wolfgang Grandegger wrote:
>>> On 06/19/2012 11:04 AM, Gilles Chanteperdrix wrote:
>>>> On 06/19/2012 10:52 AM, Wolfgang Grandegger wrote:
>>>>> On 06/19/2012 10:50 AM, Gilles Chanteperdrix wrote:
>>>>>> On 06/19/2012 10:49 AM, Wolfgang Grandegger wrote:
>>>>>>> On 06/19/2012 10:33 AM, Gilles Chanteperdrix wrote:
>>>>>>>> On 06/19/2012 10:25 AM, Wolfgang Grandegger wrote:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> the shared memory support of Xenomai's POSIX skin currently only support
>>>>>>>>> shared memory between rt processes.
>>>>>>>>
>>>>>>>> These services are for sharing memory between user-space and
>>>>>>>> kernel-space. In order to share memory between user-space processes, you
>>>>>>>> can use plain linux shared memories.
>>>>>>>
>>>>>>> But then I will get mode switches due to page faults, right?
>>>>>>
>>>>>> No, there should not be any page fault.
>>>>>
>>>>> But that's what we observe on a i.MX53 and i.MX6Q board. IIRC, the first
>>>>> access usually results in a page fault.
>>>>
>>>> And you do not get the same behaviour with posix skin shared memories ?
>>>
>>> Right, and that's because do_pagefault() is called somewhere in the
>>> initialization, IIRC. But I will redo my tests now.
>>
>> Yes, I forgot about that, we pre-fault shared memory on ARM, in order to
>> avoid the page fault on first access.
>>
>>>
>>> Anyway, if I use the POSIX skin the shared memory functions in there
>>> will be used automatically. But I could use  __real_shm_open and
>>> __real_mmap, right?
>>
>> Or you can used the wrapped version, but without enabling support for
>> xenomai posix shared memories in the kernel configuration.
>>
>>
>>  ... and access the page once per page in the
>>> initialization phase. Then no more page faults should happen.
>>
>> Yes. It is a bit ugly, but should work.
> 
> I forgot. The problem was not the read but the first write to a page
> triggering the page fault. Therefore it would make sense to wrap just
> mmap and doing the pre-faulting if XENO_OPT_POSIX_SHM is not set.

Yes, when we prefault in kernel-space, we prefault write faults. We can
do that, yes.

-- 
					    Gilles.


      reply	other threads:[~2012-06-20  9:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19  8:25 [Xenomai] Sharing memory between rt-posix and standard-posix apps Wolfgang Grandegger
2012-06-19  8:33 ` Gilles Chanteperdrix
2012-06-19  8:49   ` Wolfgang Grandegger
2012-06-19  8:50     ` Gilles Chanteperdrix
2012-06-19  8:52       ` Wolfgang Grandegger
2012-06-19  9:04         ` Gilles Chanteperdrix
2012-06-19  9:29           ` Wolfgang Grandegger
2012-06-19  9:38             ` Gilles Chanteperdrix
2012-06-20  7:33               ` Wolfgang Grandegger
2012-06-20  9:18                 ` Gilles Chanteperdrix [this message]

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=4FE19564.6020502@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Xenomai@xenomai.org \
    --cc=wg@grandegger.com \
    /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.