Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94d6a5f7 authored by Serge E. Hallyn's avatar Serge E. Hallyn Committed by James Morris
Browse files

user namespaces: document CFS behavior



Documented the currently bogus state of support for CFS user groups with
user namespaces.  In particular, all users in a user namespace should be
children of the user which created the user namespace.  This is yet to
be implemented.

Signed-off-by: default avatarSerge E. Hallyn <serue@us.ibm.com>
Acked-by: default avatarDhaval Giani <dhaval@linux.vnet.ibm.com>

Signed-off-by: default avatarSerge E. Hallyn <serue@us.ibm.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 7657d904
Loading
Loading
Loading
Loading
+21 −0
Original line number Original line Diff line number Diff line
@@ -273,3 +273,24 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem.


	# #Launch gmplayer (or your favourite movie player)
	# #Launch gmplayer (or your favourite movie player)
	# echo <movie_player_pid> > multimedia/tasks
	# echo <movie_player_pid> > multimedia/tasks

8. Implementation note: user namespaces

User namespaces are intended to be hierarchical.  But they are currently
only partially implemented.  Each of those has ramifications for CFS.

First, since user namespaces are hierarchical, the /sys/kernel/uids
presentation is inadequate.  Eventually we will likely want to use sysfs
tagging to provide private views of /sys/kernel/uids within each user
namespace.

Second, the hierarchical nature is intended to support completely
unprivileged use of user namespaces.  So if using user groups, then
we want the users in a user namespace to be children of the user
who created it.

That is currently unimplemented.  So instead, every user in a new
user namespace will receive 1024 shares just like any user in the
initial user namespace.  Note that at the moment creation of a new
user namespace requires each of CAP_SYS_ADMIN, CAP_SETUID, and
CAP_SETGID.
+7 −1
Original line number Original line Diff line number Diff line
@@ -239,7 +239,13 @@ static struct kobj_type uids_ktype = {
	.release = uids_release,
	.release = uids_release,
};
};


/* create /sys/kernel/uids/<uid>/cpu_share file for this user */
/*
 * Create /sys/kernel/uids/<uid>/cpu_share file for this user
 * We do not create this file for users in a user namespace (until
 * sysfs tagging is implemented).
 *
 * See Documentation/scheduler/sched-design-CFS.txt for ramifications.
 */
static int uids_user_create(struct user_struct *up)
static int uids_user_create(struct user_struct *up)
{
{
	struct kobject *kobj = &up->kobj;
	struct kobject *kobj = &up->kobj;