From: ebiederm@xmission.com (Eric W. Biederman)
To: Kirill Korotaev <dev@sw.ru>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
xemul@sw.ru, ebiederm@xmission.com, haveblue@us.ibm.com,
linux-kernel@vger.kernel.org, herbert@13thfloor.at,
devel@openvz.org, serue@us.ibm.com, sam@vilain.net
Subject: Re: [RFC][PATCH 2/2] Virtualization of IPC
Date: Fri, 24 Mar 2006 13:09:20 -0700 [thread overview]
Message-ID: <m14q1niozz.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <44242DFE.3090601@sw.ru> (Kirill Korotaev's message of "Fri, 24 Mar 2006 20:35:58 +0300")
Kirill Korotaev <dev@sw.ru> writes:
> This patch introduces IPC namespaces, which allow to create isolated IPC users
> or containers.
> Introduces CONFIG_IPC_NS and ipc_namespace structure.
> It also uses current->ipc_ns as a pointer to current namespace, which reduces
> places where additional argument to functions should be added.
I don't see where we are freeing the shared memory segments,
the message queues and the semaphores when the last user of the namespace
goes away. Am I missing something?
> --- a/include/linux/ipc.h
> +++ b/include/linux/ipc.h
> @@ -70,6 +70,50 @@ struct kern_ipc_perm
>
> #endif /* __KERNEL__ */
>
> +#include <linux/config.h>
> +
> +#ifdef CONFIG_IPC_NS
> +#include <asm/atomic.h>
> +
> +struct ipc_ids;
> +struct ipc_namespace {
> + atomic_t cnt;
> +
> + struct ipc_ids *sem_ids;
> + int sem_ctls[4];
> + int used_sems;
> +
> + struct ipc_ids *msg_ids;
> + int msg_ctlmax;
> + int msg_ctlmnb;
> + int msg_ctlmni;
> +
> + struct ipc_ids *shm_ids;
> + size_t shm_ctlmax;
> + size_t shm_ctlall;
> + int shm_ctlmni;
> + int shm_total;
> +};
I believe there is a small problem with this implementation.
per namespace counts and limits are fine. But I think we want
to maintain true global limits as well. I know
concerns of that nature have been expressed in regards
to Daves patch.
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -1193,6 +1193,7 @@ static task_t *copy_process(unsigned lon
> attach_pid(p, PIDTYPE_TGID, p->tgid);
> attach_pid(p, PIDTYPE_PID, p->pid);
> get_uts_ns(p->uts_ns);
> + get_ipc_ns(p->ipc_ns);
>
> nr_threads++;
> total_forks++;
Again please move the get outside of the tasklist_lock.
Eric
next prev parent reply other threads:[~2006-03-24 20:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-24 17:23 [RFC] Virtualization patches for IPC/UTS. 2nd step Kirill Korotaev
2006-03-24 17:31 ` [RFC][PATCH 1/2] Virtualization of UTS Kirill Korotaev
2006-03-24 19:09 ` Eric W. Biederman
2006-03-24 19:35 ` Kirill Korotaev
2006-03-24 19:50 ` Eric W. Biederman
2006-03-27 19:40 ` Eric W. Biederman
2006-03-24 20:28 ` James Morris
2006-03-28 3:45 ` Sam Vilain
2006-03-24 17:35 ` [RFC][PATCH 2/2] Virtualization of IPC Kirill Korotaev
2006-03-24 19:13 ` Dave Hansen
2006-03-24 21:27 ` Herbert Poetzl
2006-03-28 5:26 ` Sam Vilain
2006-03-24 20:09 ` Eric W. Biederman [this message]
2006-03-27 15:33 ` Serge E. Hallyn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m14q1niozz.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@osdl.org \
--cc=dev@sw.ru \
--cc=devel@openvz.org \
--cc=haveblue@us.ibm.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@vilain.net \
--cc=serue@us.ibm.com \
--cc=torvalds@osdl.org \
--cc=xemul@sw.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®