kernel/team: Do not inherit anything from the kernel's IO context.

We already didn't inherit FDs, which meant that the only thing we
did meaningfully inherit was the table size. That meant that basically
no applications actually had a table size of the default 256, but all
were at the kernel's 4096 (except Tracker and anything started by it,
as Tracker resets it to 512), and also that basically all applications
had FD tables allocated with the raw allocator instead of the block
allocator, which isn't very efficient.

Since this reduces the default FD table size, some applications
might encounter problems. However, build systems and other such
tools should already increase this by default as needed, and it's
easy enough to patch in calls to setrlimit() if it turns out
some applications needed a higher default after all.

Also remove a redundant call to vfs_exec_io_context. Calling
vfs_new_io_context with the second argument set to "true"
already skips cloning CLOEXEC FDs.
This commit is contained in:
Augustin Cavalier
2025-01-03 12:26:13 -05:00
parent 9479a57c4e
commit 66f51cb3b9
3 changed files with 31 additions and 33 deletions
-1
View File
@@ -59,7 +59,6 @@ typedef struct io_context {
struct list node_monitors;
uint32 num_monitors;
uint32 max_monitors;
bool inherit_fds;
} io_context;