Re: [PATCH 01/23] tref: Implement task references.
From: Eric W. Biederman
Date: Thu Feb 23 2006 - 11:48:29 EST
ebiederm@xxxxxxxxxxxx (Eric W. Biederman) writes:
> Holding a reference to a task_struct pins about 10K of low memory even
> after that task has exited. Which seems to be at 1 or 2 orders of
> mangnitude more memory than any other data structure in the kernel.
> Not holding a reference to a task_struct and you risk problems with
> pid wrap around.
>
> Even worse because we allow session and process group leaders to exit
> there is no task_struct you can hold onto to prevent pid wrap around
> problems for those kinds of structures.
>
> The task_ref is an small intermediate data structure that other
> structures can point, that solves these problems. A task_ref will
> always point at the first user of a pid value or contain a NULL
> pointer if there are no longer any users of that pid.
I forgot to note that there is a correctness dependence on an my
kill switch_exec_pids patch. Without that task_refs will
stop being able to track a pid when we pass it on to
a new process in de_thread.
I built this patchset against Linus latest kernel and not -mm so I think
I may have one or two trivial conflicts with Olegs changes as
well. In particular I have some changes to unhash_process() that Oleg
has removed, but simply removing that hunch should be all the resolution
that is needed. Hopefully that won't be a problem..
Eric
-
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/