Hello,

dnie...@gmail.com, le sam. 17 mai 2025 23:56:15 +0100, a ecrit:
> The ext2fs side of the changes seems to be as strightforward
> as calling setrlimit when the bootstraap port is null, given
> the following lines of diskfs_init_main:

I'm thinking that it's not just the bootstrap fs that should raise the
limitation. E.g. on buildds it's the building chroot that is supposed to
eat most memory for the page cache. And it's not just about ext2fs, but
also fatfs etc. Actually I'd say anything that uses libpager and thus
know to behave when the kernel thinks we are short on memory. So I'm
thinking that we should just put it in pager_start_workers

> I'm not sure abount the bit declaring variables inside the if
> block being conforming to the standards.

See the rest of the code, it's used abundantly: it has been allowed
since essentially ever :)

> But I still need to figure out how to install the headers with the new
> RPC routines.

You can as well just copy over the .defs file by hand.

> diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
> index 3836bdf6..689e5e5b 100644
> --- a/ext2fs/ext2fs.c
> +++ b/ext2fs/ext2fs.c
> @@ -230,6 +232,15 @@ main (int argc, char **argv)
>    store = diskfs_init_main (&startup_argp, argc, argv,
>                           &store_parsed, &bootstrap);
>  
> +  /* Lift default address space limits when we are the root filesystem */
> +  if (bootstrap == MACH_PORT_NULL)
> +    {
> +      struct rlimit limits = { RLIM_INFINITY, RLIM_INFINITY };
> +      int err = setrlimit (RLIMIT_AS, &limits);
> +      if (err == -1)
> +        perror ("error lifting address space limits");

I don't think we want to be noisy when running non-root ext2fs :)

Or at least be noisy only in the error cases that are not just a
permission denied error.

Samuel

Reply via email to