kernel: disable freelist page caching for executables run from uncached mount
the image cache has the property of keeping a channel for the executable binary arround which prevents the mountpoint from going away. this can easily be reproduced by running: @{rfork n; ramfs; cp /bin/echo /tmp; /tmp/echo} observe how ramfs stays arround until the image is reclaimed. the echo binary is also cached but is unreachable from any namespace. we now restrict the caching to mounts that use the client cache (-C flag) only. this should always be the case for /bin. places where this isnt the case might observe a performance regression.
This commit is contained in:
parent
b66c4a6232
commit
c7c7e7ee2a
3 changed files with 8 additions and 3 deletions
|
@ -275,6 +275,7 @@ attachimage(int type, Chan *c, ulong base, ulong len)
|
|||
|
||||
lock(i);
|
||||
incref(c);
|
||||
i->nocache = (c->flag & CCACHE) == 0;
|
||||
c->flag &= ~CCACHE;
|
||||
i->c = c;
|
||||
i->type = c->type;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue