Hello,
What happens with a task resources when a task crashes or it leaks resources at exit? How this resources (e.g. memory, file descriptors, any other capabilities) are reclaimed back by the o.s. ?
Cheers, BogDan.
On Fri Jun 07, 2013 at 00:50:03 -0700, BogDan wrote:
What happens with a task resources when a task crashes or it leaks resources at exit? How this resources (e.g. memory, file descriptors, any other capabilities) are reclaimed back by the o.s. ?
FDs and caps are local to the task, so just memory. Providers need to check whether there are any further users of their resource and if not they can free it (the kernel provides support for doing so).
Adam
Hi,
What happens with a task resources when a task crashes or it leaks
resources at exit? How this resources (e.g. memory, file descriptors, any other capabilities) are reclaimed back by the o.s. ?
FDs and caps are local to the task, so just memory.
Hmm it must be a misunderstanding here, it can't be just memory because IMHO also FDs can't be local ... I can't image how they can be managed locally ... Let me give two (very similar) examples to be more clear: - when I open a file (exclusive mode) a VFS has to do something to prevent other FDs to read/write into that file, so it creates and keeps a thing (FD, capability) inside it until the application close the FD. Now the problem comes when the application exits (it crashes) without closing the FD, is there any way to notify the VFS server about it?
- when I create a socket and listen on a port, other apps can't listen on the same port, meaning that there is another server which manage this resource. Like in the previous example I don't want to reboot my os to use that port after the application crashed :)
Providers need to
check whether there are any further users of their resource and if not they can free it (the kernel provides support for doing so).
The providers need to check or they are notified by the kernel when a resources is not referenced by anyone? I'm very interested in this topic, is there any example that I can check?
Thanks!
Cheers, BogDan.
On Mon Jun 10, 2013 at 02:44:50 -0700, BogDan wrote:
FDs and caps are local to the task, so just memory.
Hmm it must be a misunderstanding here, it can't be just memory because IMHO also FDs can't be local ... I can't image how they can be managed locally ...
If the VFS is just local, the FDs are also just local. When considering a VFS service with multiple clients, then yes, there's more to do.
Let me give two (very similar) examples to be more clear:
- when I open a file (exclusive mode) a VFS has to do something to
prevent other FDs to read/write into that file, so it creates and keeps a thing (FD, capability) inside it until the application close the FD. Now the problem comes when the application exits (it crashes) without closing the FD, is there any way to notify the VFS server about it?
- when I create a socket and listen on a port, other apps can't
listen on the same port, meaning that there is another server which manage this resource. Like in the previous example I don't want to reboot my os to use that port after the application crashed :)
Providers need to
check whether there are any further users of their resource and if not they can free it (the kernel provides support for doing so).
The providers need to check or they are notified by the kernel when a resources is not referenced by anyone? I'm very interested in this topic, is there any example that I can check?
For example moe is doing this and ned too.
Adam
l4-hackers@os.inf.tu-dresden.de