OpenVZ Forum - RDF feed
type: channel
items: [Patch04/05]- Containers: Core Container support
items: Re: [Patch04/05]- Containers: Core Container support

[Patch04/05]- Containers: Core Container support
type: item
description: This patch has the definitions and other core part of container support implementing all the counters for different resources (like tasks, anon memory etc.). Signed-off-by: Rohit Seth <rohitseth@google.com> include/linux/container.h | 163 ++++++++++++ mm/container.c | 620 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 783 insertions(+) --- linux-2.6.18-rc6-mm2.org/include/linux/container.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.6.18-rc6-mm2.ctn/include/linux/container.h 2006-09-14 16:22:30.000000000 -0700 @@ -0,0 +1,163 @@ +/* + * include/linux/container.h + * container header definitions for containers. + * Copyright (c) 2006 Rohit Seth <rohitseth@google.com> + */ + +#ifndef _LINUX_CONTAINER_H +#define _LINUX_CONTAINER_H + +#ifdef CONFIG_CONTAINERS + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/mm.h> +#include <linux/errno.h> +#include <linux/nodemask.h> +#include <linux/mutex.h> +#include <linux/configfs.h> +#include <linux/workqueue.h> + +#include <asm/system.h> +#include <asm/page.h> +#include <asm/atomic.h> + +struct task_struct; +struct address_space; +struct page; + +/* + * num_files is just a number indicating how many files are currently opened by + * task(s) belonging to this container. + */ +struct container_struct { + char *name; /* Container name */ + int id; /* System wide container id */ + int freeing; /* Used for marking a freeing container. */ + unsigned long flags; /* See different bits below. */ + atomic_t wait_on_mutex; /* Number of threads waiting to grab + * container mutex. Used to make sure + * we don't free the container while there is + * someone waiting for mutex. + */ + + /* Accoutning fields. */ + atomic_t num_tasks; /* Total number of threads. */ + atomic_t num_files; /* See comment above. */ + atomic_long_t num_anon_pages; /* Anonymous pages. */ + atomic_long_t num_mapped_pages; /* File pages that are mapped. */ + atomic_long_t num_file_pages; /* Pagecache pages. */ + atomic_long_t num…
creator: Rohit Seth
date: 2006-09-15T01:42:30-00:00

Re: [Patch04/05]- Containers: Core Container support
type: item
description: On Thu, 14 Sep 2006 18:42:30 -0700 Rohit Seth <rohitseth@google.com> wrote: > This patch has the definitions and other core part of container support > implementing all the counters for different resources (like tasks, anon > memory etc.). > > +int container_add_task(struct task_struct *task, struct task_struct *parent, > + struct container_struct *ctn) > +{ What should happen if a process of thread-group is newly added/removed ? (I think only thread-group-leader can be added/removed) -Kame
creator: KAMEZAWA Hiroyuki
date: 2006-09-20T02:32:38-00:00

Re: [Patch04/05]- Containers: Core Container support
type: item
description: On Wed, 2006-09-20 at 11:32 +0900, KAMEZAWA Hiroyuki wrote: > On Thu, 14 Sep 2006 18:42:30 -0700 > Rohit Seth <rohitseth@google.com> wrote: > > > This patch has the definitions and other core part of container support > > implementing all the counters for different resources (like tasks, anon > > memory etc.). > > > > > +int container_add_task(struct task_struct *task, struct task_struct *parent, > > + struct container_struct *ctn) > > +{ > > What should happen if a process of thread-group is newly added/removed ? > (I think only thread-group-leader can be added/removed) > If there are multiple threads then each thread will need to be individually added into the container. This keeps the semantics clean and implementation simple. -rohit
creator: Rohit Seth
date: 2006-09-20T16:19:35-00:00