Re: [PATCH 4/8] Use vmalloc for large cgroups pidlist allocations

From: Li Zefan
Date: Wed Aug 19 2009 - 22:39:03 EST


Paul Menage wrote:
> From: Ben Blum <bblum@xxxxxxxxxx>
>
>
> Use vmalloc for large cgroups pidlist allocations
>
> Separates all pidlist allocation requests to a separate function that judges
> based on the requested size whether or not the array needs to be vmalloced or
> can be gotten via kmalloc, and similar for kfree/vfree.
>
> Signed-off-by: Ben Blum <bblum@xxxxxxxxxx>
> Signed-off-by: Paul Menage <menage@xxxxxxxxxx>
>

Acked-by: Li Zefan <lizf@xxxxxxxxxxxxxx>

> ---
>
> kernel/cgroup.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
> 1 files changed, 42 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index d207871..7e2b285 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -50,6 +50,7 @@
> #include <linux/smp_lock.h>
> #include <linux/pid_namespace.h>
> #include <linux/idr.h>
> +#include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
>
> #include <asm/atomic.h>
>
> @@ -2351,6 +2352,42 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan)
> */
>
> /*
> + * The following two functions "fix" the issue where there are more pids
> + * than kmalloc will give memory for; in such cases, we use vmalloc/vfree.
> + * TODO: replace with a kernel-wide solution to this problem
> + */

I come to realize the "procs" file will make it much harder to convert
vmalloc/kmalloc with a different solution..
--
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/