Hi all,
I have a dataspace, reserved as pool 1 by dm_phys, which two tasks shares. They synchronise access to the data by setting a lock at the start of the dataspace with a cmpxchg-loop. All tasks map the dataspace to their own VM area.
The problem is that if one of the tasks exists then the other would stop with a page fault error the next time it accesses the shared dataspace. Both of them where happily reading and writing to the dataspace at exactly the place where the page fault occur.
Any suggestions?
Thanks Leon
Hi Leon,
On Tuesday 19 July 2005 17:05, Leon Brits wrote:
I have a dataspace, reserved as pool 1 by dm_phys, which two tasks shares. They synchronise access to the data by setting a lock at the start of the dataspace with a cmpxchg-loop. All tasks map the dataspace to their own VM area.
The problem is that if one of the tasks exists then the other would stop with a page fault error the next time it accesses the shared dataspace. Both of them where happily reading and writing to the dataspace at exactly the place where the page fault occur.
Hmm, that might be a bug in the resource de-allocation function of dm_phys. I assume that you use the event-server, don't you? In this case, all resources (names, dataspaces, ...) bound to a task are freed at exit of the task. Which task exits? The task which allocated the dataspace or the other?
Frank
Hi Frank,
I assume that you use the event-server, don't you?
Yes.
Which task exits? The task which allocated the dataspace or the other?
The dataspace is setup by a third task which setup the initial structures inside the dataspace. This task serves as a server that grants access to the dataspace when the other tasks requests the dataspace id from the server and maps it into their own VM space. They all get Read and Write access.
The initial task (owner) is still running and working after I halt the task which caused the page fault.
My task that page faults is a L4Linux server and my virtual NIC (kernel module) was accessing the shared dataspace. As previously discussed, I use emul_l4rm.c to map the dataspace into the kernel VM space and this has been running for weeks without a glitch. Until now when another L4 tasks, which also shares the dataspace, died.
Thanks for your help! Leon
l4-hackers@os.inf.tu-dresden.de