Sharing memory between rt-posix and standard-posix apps
Hello,
the shared memory support of Xenomai's POSIX skin currently only support shared memory between rt processes. I mean, all apps must be linked against Xenomai's POSIX library. Shared memory created by apps linked against the standard POSIX library will not be found. Is/was there a good reason for that limitation?
Wolfgang.
Quoted 4 lines · Wolfgang Grandegger
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.
Signature · 1 line
Gilles.
Quoted 9 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
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?
Wolfgang.
Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Wolfgang Grandegger
Hello,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
Signature · 1 line
Gilles.
Quoted 8 lines · Gilles Chanteperdrix
Quoted 7 lines · Wolfgang Grandegger
Quoted 6 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
Hello,
the shared memory support of Xenomai's POSIX skin currently only support shared memory between rt processes.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
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.
Wolfgang.
Quoted 13 lines · Wolfgang Grandegger
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Wolfgang Grandegger
Quoted 9 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
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.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
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 ?
Signature · 1 line
Gilles.
Quoted 14 lines · Gilles Chanteperdrix
Quoted 13 lines · Wolfgang Grandegger
Quoted 12 lines · Gilles Chanteperdrix
Quoted 11 lines · Wolfgang Grandegger
Quoted 9 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
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.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
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.
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? ... and access the page once per page in the initialization phase. Then no more page faults should happen.
Wolfgang.
Quoted 19 lines · Wolfgang Grandegger
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Wolfgang Grandegger
Quoted 15 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Wolfgang Grandegger
Hello,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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.
Quoted 4 lines
Anyway, if I use the POSIX skin the shared memory functions in there will be used automatically. But I could use
__real_shm_openand__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
Quoted 1 line
initialization phase. Then no more page faults should happen.
Yes. It is a bit ugly, but should work.
Signature · 1 line
Gilles.
Quoted 36 lines · Gilles Chanteperdrix
Quoted 19 lines · Wolfgang Grandegger
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Wolfgang Grandegger
Quoted 15 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Wolfgang Grandegger
Hello,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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.
Quoted 4 lines
Anyway, if I use the POSIX skin the shared memory functions in there will be used automatically. But I could use
__real_shm_openand__real_mmap, right?
Quoted 8 lines
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
Quoted 1 line
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.
Wolfgang.
Quoted 41 lines · Wolfgang Grandegger
Quoted 40 lines · Gilles Chanteperdrix
Quoted 19 lines · Wolfgang Grandegger
Quoted 18 lines · Gilles Chanteperdrix
Quoted 17 lines · Wolfgang Grandegger
Quoted 15 lines · Gilles Chanteperdrix
Quoted 4 lines · Wolfgang Grandegger
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Wolfgang Grandegger
Hello,
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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.
Quoted 4 lines
Anyway, if I use the POSIX skin the shared memory functions in there will be used automatically. But I could use
__real_shm_openand__real_mmap, right?Or you can used the wrapped version, but without enabling support for xenomai posix shared memories in the kernel configuration.
Quoted 8 lines
Quoted 4 lines
... and access the page once per page in the
Quoted 1 line
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_SHMis not set.
Yes, when we prefault in kernel-space, we prefault write faults. We can do that, yes.
Signature · 1 line
Gilles.