From: ebiederm@xmission.com (Eric W. Biederman)
To: Kirill Korotaev <dev@sw.ru>
Cc: Dave Hansen <haveblue@us.ibm.com>, Sam Vilain <sam@vilain.net>,
linux-kernel@vger.kernel.org,
Herbert Poetzl <herbert@13thfloor.at>,
OpenVZ developers list <dev@openvz.org>,
"Serge E.Hallyn" <serue@us.ibm.com>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [RFC] [PATCH 0/7] Some basic vserver infrastructure
Date: Fri, 24 Mar 2006 13:28:49 -0700 [thread overview]
Message-ID: <m13bh7io3i.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <44241224.9000200@sw.ru> (Kirill Korotaev's message of "Fri, 24 Mar 2006 18:37:08 +0300")
Kirill Korotaev <dev@sw.ru> writes:
>> I certainly have not. I do feel that developing this just from the
>> top down is the wrong way to do this. In some of the preliminary
>> patches we have found several pieces of code that we will have to
>> touch that is currently in need of a cleanup. That is why I have
>> been cleaning up /proc. sysctl is in need of similar treatment
>> but is in less bad shape.
> Eric, though I suggest to postpone proc and sysctl a bit, can you share
> me your vision of /proc and /sysctl virtualization a bit?
> A good way to handle them IMHO is to make fully virtual, i.e. each
> namespace should have an own set of sysctl or proc tree.
Roughly I agree. Some cases are easier than others. So let me take
just the sysvipc case as an example.
My thinking is move the calls for printing the sysvipc namespace
from fs/proc/generic.c (with all of it's cool helpers) to
fs/proc/base.c.
So we wind up with:
/proc/<pid>/sysvipc/msg
/proc/<pid>/sysvipc/sem
/proc/<pid>/sysvipc/shm
/proc/sysvipc -> /proc/self/sysvipc
For sysctl we add a method to fetch the address of
the variable and perhaps a few other attributes,
that method is passed a task structure.
Then we can have per process instances of:
/proc/<pid>/sys/sem
/proc/<pid>/sys/shmall
/proc/<pid>/sys/shmmax
/proc/<pid>/sys/msgmax
/proc/<pid>/sys/msgmni
/proc/<pid>/sys/shmmni
And a symlink at:
/proc/sys that points to /proc/<pid>/sys
Getting sysvipc to show up in a per process fashion is pretty
easy. Getting the entire sys hierarchy to show up per process
is a little harder simply because I think to do it cleanly requires
help functions that I don't have yet. I have removed all of
the internal dependence on magic inode numbers completely removing
the hard coded inode numbers and putting sys looks doable.
Does that sound like a reasonable model?
>> Part of it is that I have stopped to look more closely at what
>> other people are doing and to look at alternative implementations.
> If you need any help with it in OpenVZ, feel free to ask. We have
> broken-out patches for recent 2.6.16 kernel.
>> One interesting thing I have manged to do is by using ptrace I
>> have implemented enter for the existing filesystem namespaces without having
>> to modify the kernel. This at least says
>> that enter and debugging are two faces of the same coin.
> Hmmm, strange claim/conclusion... /dev/kmem allows to change namespaces
> also :) and even to obtain root priviliges if needed... :)
True. However this is much less ugly then using /dev/kmem, and it is
much closer to what applications like user mode linux do. The primary
question in my mind was what should the permissions checks be when
performing this kind of action. Using ptrace satisfied that.
So I now have a bounding box for what enter should be able to do
and what permissions it should take.
> Eric, let's not compare approaches with inches :)
> As you remember your PID namespaces doesn't suite us well... :(
More discussion when the time is right. But I believe I have solved
the fundamental incompatibility that we had. I asked you a question
to confirm that a while ago, but I have not heard anything back.
Eric
next prev parent reply other threads:[~2006-03-24 20:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060321061333.27638.63963.stgit@localhost.localdomain>
2006-03-21 18:50 ` Dave Hansen
2006-03-21 21:08 ` Sam Vilain
2006-03-21 21:32 ` Dave Hansen
2006-03-21 23:12 ` Sam Vilain
2006-03-22 5:18 ` Sam Vilain
2006-03-22 7:13 ` Eric W. Biederman
2006-03-23 4:17 ` Sam Vilain
2006-03-24 15:36 ` [Devel] " Kirill Korotaev
2006-03-27 12:45 ` Serge E. Hallyn
2006-03-28 5:28 ` Sam Vilain
2006-03-29 12:07 ` Kirill Korotaev
2006-03-29 13:47 ` Serge E. Hallyn
2006-03-29 21:30 ` Sam Vilain
2006-04-19 7:50 ` Eric W. Biederman
2006-04-19 21:42 ` Sam Vilain
2006-03-22 6:41 ` Eric W. Biederman
2006-03-23 4:29 ` Sam Vilain
2006-03-23 4:50 ` Andrew Morton
2006-03-24 15:38 ` Kirill Korotaev
2006-03-24 15:37 ` Kirill Korotaev
2006-03-24 20:28 ` Eric W. Biederman [this message]
2006-03-24 21:01 ` Herbert Poetzl
2006-03-24 21:13 ` Eric W. Biederman
2006-03-24 21:40 ` Herbert Poetzl
2006-03-24 22:30 ` Eric W. Biederman
2006-03-25 18:37 ` Eric W. Biederman
[not found] ` <20060321061333.27638.9112.stgit@localhost.localdomain>
2006-03-21 18:53 ` [RFC] [PATCH 1/7] Add process virtualisation umbrella structure (vx_info) Dave Hansen
2006-03-21 21:52 ` Sam Vilain
2006-03-22 2:02 ` Herbert Poetzl
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=m13bh7io3i.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=akpm@osdl.org \
--cc=dev@openvz.org \
--cc=dev@sw.ru \
--cc=haveblue@us.ibm.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@vilain.net \
--cc=serue@us.ibm.com \
/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
Powered by JetHome