Re: message queue limits

From: Andrew Morton
Date: Fri Apr 16 2004 - 16:42:09 EST


Marcelo Tosatti <marcelo.tosatti@xxxxxxxxxxxx> wrote:
>
> This should be working, but for some reason rlim[RLIMIT_MSGQUEUE].rlim_cur of
> all tasks is 0, remembering it sets init_tasks's value at ipc/mqueue.c's __init function:
>
> init_task.rlim[RLIMIT_MSGQUEUE].rlim_cur = 64;
> init_task.rlim[RLIMIT_MSGQUEUE].rlim_max = 64;

init_task is the task_struct for process 0, "swapper". But by the time we
run the initcalls, process 1 ("init") is up and running.

So by the time you execute these assignments, you're changing the limits on
a process which will never again create any children.

It's a bit hacky, but you could do

BUG_ON(current->pid != 1);
current->rlim[RLIMIT_MSGQUEUE].rlim_cur = 64;

but longer-term these initialisations should be moved into
include/asm-foo/reousrce.h:INIT_RLIMITS
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/