All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sched: Remove remaining USER_SCHED code
@ 2010-03-24  5:17 Li Zefan
  2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Li Zefan @ 2010-03-24  5:17 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Dhaval Giani, David Howells, LKML

This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")

Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 init/Kconfig            |    3 +--
 kernel/capability.c     |    1 -
 kernel/cred-internals.h |   21 ---------------------
 kernel/cred.c           |    3 ---
 kernel/exit.c           |    1 -
 kernel/sched_debug.c    |    5 -----
 kernel/user.c           |   10 +---------
 7 files changed, 2 insertions(+), 42 deletions(-)
 delete mode 100644 kernel/cred-internals.h

diff --git a/init/Kconfig b/init/Kconfig
index c6c8903..f173018 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -604,8 +604,7 @@ config RT_GROUP_SCHED
 	default n
 	help
 	  This feature lets you explicitly allocate real CPU bandwidth
-	  to users or control groups (depending on the "Basis for grouping tasks"
-	  setting below. If enabled, it will also make it impossible to
+	  to task groups. If enabled, it will also make it impossible to
 	  schedule realtime tasks for non-root users until you allocate
 	  realtime bandwidth for them.
 	  See Documentation/scheduler/sched-rt-group.txt for more information.
diff --git a/kernel/capability.c b/kernel/capability.c
index 9e4697e..2f05303 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,7 +15,6 @@
 #include <linux/syscalls.h>
 #include <linux/pid_namespace.h>
 #include <asm/uaccess.h>
-#include "cred-internals.h"
 
 /*
  * Leveraged for setting/resetting capabilities
diff --git a/kernel/cred-internals.h b/kernel/cred-internals.h
deleted file mode 100644
index 2dc4fc2..0000000
--- a/kernel/cred-internals.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Internal credentials stuff
- *
- * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-
-/*
- * user.c
- */
-static inline void sched_switch_user(struct task_struct *p)
-{
-#ifdef CONFIG_USER_SCHED
-	sched_move_task(p);
-#endif	/* CONFIG_USER_SCHED */
-}
-
diff --git a/kernel/cred.c b/kernel/cred.c
index 1ed8ca1..69a4da6 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -16,7 +16,6 @@
 #include <linux/init_task.h>
 #include <linux/security.h>
 #include <linux/cn_proc.h>
-#include "cred-internals.h"
 
 #if 0
 #define kdebug(FMT, ...) \
@@ -553,8 +552,6 @@ int commit_creds(struct cred *new)
 		atomic_dec(&old->user->processes);
 	alter_cred_subscribers(old, -2);
 
-	sched_switch_user(task);
-
 	/* send notifications */
 	if (new->uid   != old->uid  ||
 	    new->euid  != old->euid ||
diff --git a/kernel/exit.c b/kernel/exit.c
index cce59cb..84dc4b2 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -55,7 +55,6 @@
 #include <asm/unistd.h>
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
-#include "cred-internals.h"
 
 static void exit_mm(struct task_struct * tsk);
 
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 8a46a71..0932c5c 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -173,11 +173,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 	task_group_path(tg, path, sizeof(path));
 
 	SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
-#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
-	{
-		uid_t uid = cfs_rq->tg->uid;
-		SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
-	}
 #else
 	SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
 #endif
diff --git a/kernel/user.c b/kernel/user.c
index ec3b222..8e1c8c0 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -16,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/user_namespace.h>
-#include "cred-internals.h"
 
 struct user_namespace init_user_ns = {
 	.kref = {
@@ -137,9 +136,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
 	struct hlist_head *hashent = uidhashentry(ns, uid);
 	struct user_struct *up, *new;
 
-	/* Make uid_hash_find() + uids_user_create() + uid_hash_insert()
-	 * atomic.
-	 */
+	/* Make uid_hash_find() + uid_hash_insert() atomic. */
 	spin_lock_irq(&uidhash_lock);
 	up = uid_hash_find(uid, hashent);
 	spin_unlock_irq(&uidhash_lock);
@@ -161,11 +158,6 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
 		spin_lock_irq(&uidhash_lock);
 		up = uid_hash_find(uid, hashent);
 		if (up) {
-			/* This case is not possible when CONFIG_USER_SCHED
-			 * is defined, since we serialize alloc_uid() using
-			 * uids_mutex. Hence no need to call
-			 * sched_destroy_user() or remove_user_sysfs_dir().
-			 */
 			key_put(new->uid_keyring);
 			key_put(new->session_keyring);
 			kmem_cache_free(uid_cachep, new);
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] sched: Remove USER_SCHED from documentation
  2010-03-24  5:17 [PATCH 1/2] sched: Remove remaining USER_SCHED code Li Zefan
@ 2010-03-24  5:17 ` Li Zefan
  2010-03-24 14:35   ` Serge E. Hallyn
  2010-04-02 19:11   ` [tip:sched/core] " tip-bot for Li Zefan
  2010-03-26 15:51 ` [PATCH 1/2] sched: Remove remaining USER_SCHED code Dhaval Giani
  2010-04-02 19:11 ` [tip:sched/core] " tip-bot for Li Zefan
  2 siblings, 2 replies; 6+ messages in thread
From: Li Zefan @ 2010-03-24  5:17 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Dhaval Giani, Serge E. Hallyn, LKML

USER_SCHED has been removed, so update the documentation
accordingly.

Cc: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 Documentation/scheduler/sched-design-CFS.txt |   54 +------------------------
 Documentation/scheduler/sched-rt-group.txt   |   20 ++--------
 2 files changed, 7 insertions(+), 67 deletions(-)

diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
index 6f33593..8239ebb 100644
--- a/Documentation/scheduler/sched-design-CFS.txt
+++ b/Documentation/scheduler/sched-design-CFS.txt
@@ -211,7 +211,7 @@ provide fair CPU time to each such task group.  For example, it may be
 desirable to first provide fair CPU time to each user on the system and then to
 each task belonging to a user.
 
-CONFIG_GROUP_SCHED strives to achieve exactly that.  It lets tasks to be
+CONFIG_CGROUP_SCHED strives to achieve exactly that.  It lets tasks to be
 grouped and divides CPU time fairly among such groups.
 
 CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and
@@ -220,38 +220,11 @@ SCHED_RR) tasks.
 CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and
 SCHED_BATCH) tasks.
 
-At present, there are two (mutually exclusive) mechanisms to group tasks for
-CPU bandwidth control purposes:
-
- - Based on user id (CONFIG_USER_SCHED)
-
-   With this option, tasks are grouped according to their user id.
-
- - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED)
-
-   This options needs CONFIG_CGROUPS to be defined, and lets the administrator
+   These options need CONFIG_CGROUPS to be defined, and let the administrator
    create arbitrary groups of tasks, using the "cgroup" pseudo filesystem.  See
    Documentation/cgroups/cgroups.txt for more information about this filesystem.
 
-Only one of these options to group tasks can be chosen and not both.
-
-When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new
-user and a "cpu_share" file is added in that directory.
-
-	# cd /sys/kernel/uids
-	# cat 512/cpu_share		# Display user 512's CPU share
-	1024
-	# echo 2048 > 512/cpu_share	# Modify user 512's CPU share
-	# cat 512/cpu_share		# Display user 512's CPU share
-	2048
-	#
-
-CPU bandwidth between two users is divided in the ratio of their CPU shares.
-For example: if you would like user "root" to get twice the bandwidth of user
-"guest," then set the cpu_share for both the users such that "root"'s cpu_share
-is twice "guest"'s cpu_share.
-
-When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each
+When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
 group created using the pseudo filesystem.  See example steps below to create
 task groups and modify their CPU share using the "cgroups" pseudo filesystem.
 
@@ -273,24 +246,3 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem.
 
 	# #Launch gmplayer (or your favourite movie player)
 	# 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.
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 86eabe6..605b0d4 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -126,23 +126,12 @@ priority!
 2.3 Basis for grouping tasks
 ----------------------------
 
-There are two compile-time settings for allocating CPU bandwidth. These are
-configured using the "Basis for grouping tasks" multiple choice menu under
-General setup > Group CPU Scheduler:
-
-a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" =  "user id")
-
-This lets you use the virtual files under
-"/sys/kernel/uids/<uid>/cpu_rt_runtime_us" to control he CPU time reserved for
-each user .
-
-The other option is:
-
-.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
+Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real
+CPU bandwidth to task groups.
 
 This uses the /cgroup virtual file system and
 "/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each
-control group instead.
+control group.
 
 For more information on working with control groups, you should read
 Documentation/cgroups/cgroups.txt as well.
@@ -161,8 +150,7 @@ For now, this can be simplified to just the following (but see Future plans):
 ===============
 
 There is work in progress to make the scheduling period for each group
-("/sys/kernel/uids/<uid>/cpu_rt_period_us" or
-"/cgroup/<cgroup>/cpu.rt_period_us" respectively) configurable as well.
+("/cgroup/<cgroup>/cpu.rt_period_us") configurable as well.
 
 The constraint on the period is that a subgroup must have a smaller or
 equal period to its parent. But realistically its not very useful _yet_
-- 
1.6.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] sched: Remove USER_SCHED from documentation
  2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
@ 2010-03-24 14:35   ` Serge E. Hallyn
  2010-04-02 19:11   ` [tip:sched/core] " tip-bot for Li Zefan
  1 sibling, 0 replies; 6+ messages in thread
From: Serge E. Hallyn @ 2010-03-24 14:35 UTC (permalink / raw)
  To: Li Zefan; +Cc: Ingo Molnar, Peter Zijlstra, Dhaval Giani, LKML

Quoting Li Zefan (lizf@cn.fujitsu.com):
> USER_SCHED has been removed, so update the documentation
> accordingly.
> 
> Cc: Serge E. Hallyn <serue@us.ibm.com>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

Acked-by: Serge Hallyn <serue@us.ibm.com>

thanks,
-serge

> ---
>  Documentation/scheduler/sched-design-CFS.txt |   54 +------------------------
>  Documentation/scheduler/sched-rt-group.txt   |   20 ++--------
>  2 files changed, 7 insertions(+), 67 deletions(-)
> 
> diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
> index 6f33593..8239ebb 100644
> --- a/Documentation/scheduler/sched-design-CFS.txt
> +++ b/Documentation/scheduler/sched-design-CFS.txt
> @@ -211,7 +211,7 @@ provide fair CPU time to each such task group.  For example, it may be
>  desirable to first provide fair CPU time to each user on the system and then to
>  each task belonging to a user.
> 
> -CONFIG_GROUP_SCHED strives to achieve exactly that.  It lets tasks to be
> +CONFIG_CGROUP_SCHED strives to achieve exactly that.  It lets tasks to be
>  grouped and divides CPU time fairly among such groups.
> 
>  CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and
> @@ -220,38 +220,11 @@ SCHED_RR) tasks.
>  CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and
>  SCHED_BATCH) tasks.
> 
> -At present, there are two (mutually exclusive) mechanisms to group tasks for
> -CPU bandwidth control purposes:
> -
> - - Based on user id (CONFIG_USER_SCHED)
> -
> -   With this option, tasks are grouped according to their user id.
> -
> - - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED)
> -
> -   This options needs CONFIG_CGROUPS to be defined, and lets the administrator
> +   These options need CONFIG_CGROUPS to be defined, and let the administrator
>     create arbitrary groups of tasks, using the "cgroup" pseudo filesystem.  See
>     Documentation/cgroups/cgroups.txt for more information about this filesystem.
> 
> -Only one of these options to group tasks can be chosen and not both.
> -
> -When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new
> -user and a "cpu_share" file is added in that directory.
> -
> -	# cd /sys/kernel/uids
> -	# cat 512/cpu_share		# Display user 512's CPU share
> -	1024
> -	# echo 2048 > 512/cpu_share	# Modify user 512's CPU share
> -	# cat 512/cpu_share		# Display user 512's CPU share
> -	2048
> -	#
> -
> -CPU bandwidth between two users is divided in the ratio of their CPU shares.
> -For example: if you would like user "root" to get twice the bandwidth of user
> -"guest," then set the cpu_share for both the users such that "root"'s cpu_share
> -is twice "guest"'s cpu_share.
> -
> -When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each
> +When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
>  group created using the pseudo filesystem.  See example steps below to create
>  task groups and modify their CPU share using the "cgroups" pseudo filesystem.
> 
> @@ -273,24 +246,3 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem.
> 
>  	# #Launch gmplayer (or your favourite movie player)
>  	# 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.
> diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
> index 86eabe6..605b0d4 100644
> --- a/Documentation/scheduler/sched-rt-group.txt
> +++ b/Documentation/scheduler/sched-rt-group.txt
> @@ -126,23 +126,12 @@ priority!
>  2.3 Basis for grouping tasks
>  ----------------------------
> 
> -There are two compile-time settings for allocating CPU bandwidth. These are
> -configured using the "Basis for grouping tasks" multiple choice menu under
> -General setup > Group CPU Scheduler:
> -
> -a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" =  "user id")
> -
> -This lets you use the virtual files under
> -"/sys/kernel/uids/<uid>/cpu_rt_runtime_us" to control he CPU time reserved for
> -each user .
> -
> -The other option is:
> -
> -.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
> +Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real
> +CPU bandwidth to task groups.
> 
>  This uses the /cgroup virtual file system and
>  "/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each
> -control group instead.
> +control group.
> 
>  For more information on working with control groups, you should read
>  Documentation/cgroups/cgroups.txt as well.
> @@ -161,8 +150,7 @@ For now, this can be simplified to just the following (but see Future plans):
>  ===============
> 
>  There is work in progress to make the scheduling period for each group
> -("/sys/kernel/uids/<uid>/cpu_rt_period_us" or
> -"/cgroup/<cgroup>/cpu.rt_period_us" respectively) configurable as well.
> +("/cgroup/<cgroup>/cpu.rt_period_us") configurable as well.
> 
>  The constraint on the period is that a subgroup must have a smaller or
>  equal period to its parent. But realistically its not very useful _yet_
> -- 
> 1.6.3

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] sched: Remove remaining USER_SCHED code
  2010-03-24  5:17 [PATCH 1/2] sched: Remove remaining USER_SCHED code Li Zefan
  2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
@ 2010-03-26 15:51 ` Dhaval Giani
  2010-04-02 19:11 ` [tip:sched/core] " tip-bot for Li Zefan
  2 siblings, 0 replies; 6+ messages in thread
From: Dhaval Giani @ 2010-03-26 15:51 UTC (permalink / raw)
  To: Li Zefan; +Cc: Ingo Molnar, Peter Zijlstra, David Howells, LKML

On Wed, Mar 24, 2010 at 6:17 AM, Li Zefan <lizf@cn.fujitsu.com> wrote:
> This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")
>
> Cc: David Howells <dhowells@redhat.com>
> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>

Thanks for catching it.

Ack for the user.c segments

> ---
>  init/Kconfig            |    3 +--
>  kernel/capability.c     |    1 -
>  kernel/cred-internals.h |   21 ---------------------
>  kernel/cred.c           |    3 ---
>  kernel/exit.c           |    1 -
>  kernel/sched_debug.c    |    5 -----
>  kernel/user.c           |   10 +---------
>  7 files changed, 2 insertions(+), 42 deletions(-)
>  delete mode 100644 kernel/cred-internals.h
>
> diff --git a/init/Kconfig b/init/Kconfig
> index c6c8903..f173018 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -604,8 +604,7 @@ config RT_GROUP_SCHED
>        default n
>        help
>          This feature lets you explicitly allocate real CPU bandwidth
> -         to users or control groups (depending on the "Basis for grouping tasks"
> -         setting below. If enabled, it will also make it impossible to
> +         to task groups. If enabled, it will also make it impossible to
>          schedule realtime tasks for non-root users until you allocate
>          realtime bandwidth for them.
>          See Documentation/scheduler/sched-rt-group.txt for more information.
> diff --git a/kernel/capability.c b/kernel/capability.c
> index 9e4697e..2f05303 100644
> --- a/kernel/capability.c
> +++ b/kernel/capability.c
> @@ -15,7 +15,6 @@
>  #include <linux/syscalls.h>
>  #include <linux/pid_namespace.h>
>  #include <asm/uaccess.h>
> -#include "cred-internals.h"
>
>  /*
>  * Leveraged for setting/resetting capabilities
> diff --git a/kernel/cred-internals.h b/kernel/cred-internals.h
> deleted file mode 100644
> index 2dc4fc2..0000000
> --- a/kernel/cred-internals.h
> +++ /dev/null
> @@ -1,21 +0,0 @@
> -/* Internal credentials stuff
> - *
> - * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
> - * Written by David Howells (dhowells@redhat.com)
> - *
> - * This program is free software; you can redistribute it and/or
> - * modify it under the terms of the GNU General Public Licence
> - * as published by the Free Software Foundation; either version
> - * 2 of the Licence, or (at your option) any later version.
> - */
> -
> -/*
> - * user.c
> - */
> -static inline void sched_switch_user(struct task_struct *p)
> -{
> -#ifdef CONFIG_USER_SCHED
> -       sched_move_task(p);
> -#endif /* CONFIG_USER_SCHED */
> -}
> -
> diff --git a/kernel/cred.c b/kernel/cred.c
> index 1ed8ca1..69a4da6 100644
> --- a/kernel/cred.c
> +++ b/kernel/cred.c
> @@ -16,7 +16,6 @@
>  #include <linux/init_task.h>
>  #include <linux/security.h>
>  #include <linux/cn_proc.h>
> -#include "cred-internals.h"
>
>  #if 0
>  #define kdebug(FMT, ...) \
> @@ -553,8 +552,6 @@ int commit_creds(struct cred *new)
>                atomic_dec(&old->user->processes);
>        alter_cred_subscribers(old, -2);
>
> -       sched_switch_user(task);
> -
>        /* send notifications */
>        if (new->uid   != old->uid  ||
>            new->euid  != old->euid ||
> diff --git a/kernel/exit.c b/kernel/exit.c
> index cce59cb..84dc4b2 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -55,7 +55,6 @@
>  #include <asm/unistd.h>
>  #include <asm/pgtable.h>
>  #include <asm/mmu_context.h>
> -#include "cred-internals.h"
>
>  static void exit_mm(struct task_struct * tsk);
>
> diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
> index 8a46a71..0932c5c 100644
> --- a/kernel/sched_debug.c
> +++ b/kernel/sched_debug.c
> @@ -173,11 +173,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
>        task_group_path(tg, path, sizeof(path));
>
>        SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
> -#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
> -       {
> -               uid_t uid = cfs_rq->tg->uid;
> -               SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
> -       }
>  #else
>        SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
>  #endif
> diff --git a/kernel/user.c b/kernel/user.c
> index ec3b222..8e1c8c0 100644
> --- a/kernel/user.c
> +++ b/kernel/user.c
> @@ -16,7 +16,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/module.h>
>  #include <linux/user_namespace.h>
> -#include "cred-internals.h"
>
>  struct user_namespace init_user_ns = {
>        .kref = {
> @@ -137,9 +136,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
>        struct hlist_head *hashent = uidhashentry(ns, uid);
>        struct user_struct *up, *new;
>
> -       /* Make uid_hash_find() + uids_user_create() + uid_hash_insert()
> -        * atomic.
> -        */
> +       /* Make uid_hash_find() + uid_hash_insert() atomic. */
>        spin_lock_irq(&uidhash_lock);
>        up = uid_hash_find(uid, hashent);
>        spin_unlock_irq(&uidhash_lock);
> @@ -161,11 +158,6 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
>                spin_lock_irq(&uidhash_lock);
>                up = uid_hash_find(uid, hashent);
>                if (up) {
> -                       /* This case is not possible when CONFIG_USER_SCHED
> -                        * is defined, since we serialize alloc_uid() using
> -                        * uids_mutex. Hence no need to call
> -                        * sched_destroy_user() or remove_user_sysfs_dir().
> -                        */
>                        key_put(new->uid_keyring);
>                        key_put(new->session_keyring);
>                        kmem_cache_free(uid_cachep, new);
> --
> 1.6.3
>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:sched/core] sched: Remove remaining USER_SCHED code
  2010-03-24  5:17 [PATCH 1/2] sched: Remove remaining USER_SCHED code Li Zefan
  2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
  2010-03-26 15:51 ` [PATCH 1/2] sched: Remove remaining USER_SCHED code Dhaval Giani
@ 2010-04-02 19:11 ` tip-bot for Li Zefan
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Li Zefan @ 2010-04-02 19:11 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, dhaval.giani, hpa, mingo, a.p.zijlstra, lizf,
	dhowells, tglx, mingo

Commit-ID:  32bd7eb5a7f4596c8440dd9440322fe9e686634d
Gitweb:     http://git.kernel.org/tip/32bd7eb5a7f4596c8440dd9440322fe9e686634d
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Wed, 24 Mar 2010 13:17:19 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 2 Apr 2010 20:12:00 +0200

sched: Remove remaining USER_SCHED code

This is left over from commit 7c9414385e ("sched: Remove USER_SCHED"")

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: David Howells <dhowells@redhat.com>
LKML-Reference: <4BA9A05F.7010407@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 init/Kconfig            |    3 +--
 kernel/capability.c     |    1 -
 kernel/cred-internals.h |   21 ---------------------
 kernel/cred.c           |    3 ---
 kernel/exit.c           |    1 -
 kernel/sched_debug.c    |    5 -----
 kernel/user.c           |   10 +---------
 7 files changed, 2 insertions(+), 42 deletions(-)

diff --git a/init/Kconfig b/init/Kconfig
index eb77e8c..5fe94b8 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -604,8 +604,7 @@ config RT_GROUP_SCHED
 	default n
 	help
 	  This feature lets you explicitly allocate real CPU bandwidth
-	  to users or control groups (depending on the "Basis for grouping tasks"
-	  setting below. If enabled, it will also make it impossible to
+	  to task groups. If enabled, it will also make it impossible to
 	  schedule realtime tasks for non-root users until you allocate
 	  realtime bandwidth for them.
 	  See Documentation/scheduler/sched-rt-group.txt for more information.
diff --git a/kernel/capability.c b/kernel/capability.c
index 9e4697e..2f05303 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -15,7 +15,6 @@
 #include <linux/syscalls.h>
 #include <linux/pid_namespace.h>
 #include <asm/uaccess.h>
-#include "cred-internals.h"
 
 /*
  * Leveraged for setting/resetting capabilities
diff --git a/kernel/cred-internals.h b/kernel/cred-internals.h
deleted file mode 100644
index 2dc4fc2..0000000
--- a/kernel/cred-internals.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Internal credentials stuff
- *
- * Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
- * Written by David Howells (dhowells@redhat.com)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public Licence
- * as published by the Free Software Foundation; either version
- * 2 of the Licence, or (at your option) any later version.
- */
-
-/*
- * user.c
- */
-static inline void sched_switch_user(struct task_struct *p)
-{
-#ifdef CONFIG_USER_SCHED
-	sched_move_task(p);
-#endif	/* CONFIG_USER_SCHED */
-}
-
diff --git a/kernel/cred.c b/kernel/cred.c
index 1b1129d..19d3ccc 100644
--- a/kernel/cred.c
+++ b/kernel/cred.c
@@ -16,7 +16,6 @@
 #include <linux/init_task.h>
 #include <linux/security.h>
 #include <linux/cn_proc.h>
-#include "cred-internals.h"
 
 #if 0
 #define kdebug(FMT, ...) \
@@ -557,8 +556,6 @@ int commit_creds(struct cred *new)
 		atomic_dec(&old->user->processes);
 	alter_cred_subscribers(old, -2);
 
-	sched_switch_user(task);
-
 	/* send notifications */
 	if (new->uid   != old->uid  ||
 	    new->euid  != old->euid ||
diff --git a/kernel/exit.c b/kernel/exit.c
index cce59cb..84dc4b2 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -55,7 +55,6 @@
 #include <asm/unistd.h>
 #include <asm/pgtable.h>
 #include <asm/mmu_context.h>
-#include "cred-internals.h"
 
 static void exit_mm(struct task_struct * tsk);
 
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 8a46a71..0932c5c 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -173,11 +173,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 	task_group_path(tg, path, sizeof(path));
 
 	SEQ_printf(m, "\ncfs_rq[%d]:%s\n", cpu, path);
-#elif defined(CONFIG_USER_SCHED) && defined(CONFIG_FAIR_GROUP_SCHED)
-	{
-		uid_t uid = cfs_rq->tg->uid;
-		SEQ_printf(m, "\ncfs_rq[%d] for UID: %u\n", cpu, uid);
-	}
 #else
 	SEQ_printf(m, "\ncfs_rq[%d]:\n", cpu);
 #endif
diff --git a/kernel/user.c b/kernel/user.c
index ec3b222..8e1c8c0 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -16,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/user_namespace.h>
-#include "cred-internals.h"
 
 struct user_namespace init_user_ns = {
 	.kref = {
@@ -137,9 +136,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
 	struct hlist_head *hashent = uidhashentry(ns, uid);
 	struct user_struct *up, *new;
 
-	/* Make uid_hash_find() + uids_user_create() + uid_hash_insert()
-	 * atomic.
-	 */
+	/* Make uid_hash_find() + uid_hash_insert() atomic. */
 	spin_lock_irq(&uidhash_lock);
 	up = uid_hash_find(uid, hashent);
 	spin_unlock_irq(&uidhash_lock);
@@ -161,11 +158,6 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
 		spin_lock_irq(&uidhash_lock);
 		up = uid_hash_find(uid, hashent);
 		if (up) {
-			/* This case is not possible when CONFIG_USER_SCHED
-			 * is defined, since we serialize alloc_uid() using
-			 * uids_mutex. Hence no need to call
-			 * sched_destroy_user() or remove_user_sysfs_dir().
-			 */
 			key_put(new->uid_keyring);
 			key_put(new->session_keyring);
 			kmem_cache_free(uid_cachep, new);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [tip:sched/core] sched: Remove USER_SCHED from documentation
  2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
  2010-03-24 14:35   ` Serge E. Hallyn
@ 2010-04-02 19:11   ` tip-bot for Li Zefan
  1 sibling, 0 replies; 6+ messages in thread
From: tip-bot for Li Zefan @ 2010-04-02 19:11 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, lizf, serue, tglx, mingo

Commit-ID:  25c2d55c00c6097e6792ebf21e31342f23b9b768
Gitweb:     http://git.kernel.org/tip/25c2d55c00c6097e6792ebf21e31342f23b9b768
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Wed, 24 Mar 2010 13:17:50 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Fri, 2 Apr 2010 20:12:01 +0200

sched: Remove USER_SCHED from documentation

USER_SCHED has been removed, so update the documentation
accordingly.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
LKML-Reference: <4BA9A07E.8070508@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/scheduler/sched-design-CFS.txt |   54 +------------------------
 Documentation/scheduler/sched-rt-group.txt   |   20 ++--------
 2 files changed, 7 insertions(+), 67 deletions(-)

diff --git a/Documentation/scheduler/sched-design-CFS.txt b/Documentation/scheduler/sched-design-CFS.txt
index 6f33593..8239ebb 100644
--- a/Documentation/scheduler/sched-design-CFS.txt
+++ b/Documentation/scheduler/sched-design-CFS.txt
@@ -211,7 +211,7 @@ provide fair CPU time to each such task group.  For example, it may be
 desirable to first provide fair CPU time to each user on the system and then to
 each task belonging to a user.
 
-CONFIG_GROUP_SCHED strives to achieve exactly that.  It lets tasks to be
+CONFIG_CGROUP_SCHED strives to achieve exactly that.  It lets tasks to be
 grouped and divides CPU time fairly among such groups.
 
 CONFIG_RT_GROUP_SCHED permits to group real-time (i.e., SCHED_FIFO and
@@ -220,38 +220,11 @@ SCHED_RR) tasks.
 CONFIG_FAIR_GROUP_SCHED permits to group CFS (i.e., SCHED_NORMAL and
 SCHED_BATCH) tasks.
 
-At present, there are two (mutually exclusive) mechanisms to group tasks for
-CPU bandwidth control purposes:
-
- - Based on user id (CONFIG_USER_SCHED)
-
-   With this option, tasks are grouped according to their user id.
-
- - Based on "cgroup" pseudo filesystem (CONFIG_CGROUP_SCHED)
-
-   This options needs CONFIG_CGROUPS to be defined, and lets the administrator
+   These options need CONFIG_CGROUPS to be defined, and let the administrator
    create arbitrary groups of tasks, using the "cgroup" pseudo filesystem.  See
    Documentation/cgroups/cgroups.txt for more information about this filesystem.
 
-Only one of these options to group tasks can be chosen and not both.
-
-When CONFIG_USER_SCHED is defined, a directory is created in sysfs for each new
-user and a "cpu_share" file is added in that directory.
-
-	# cd /sys/kernel/uids
-	# cat 512/cpu_share		# Display user 512's CPU share
-	1024
-	# echo 2048 > 512/cpu_share	# Modify user 512's CPU share
-	# cat 512/cpu_share		# Display user 512's CPU share
-	2048
-	#
-
-CPU bandwidth between two users is divided in the ratio of their CPU shares.
-For example: if you would like user "root" to get twice the bandwidth of user
-"guest," then set the cpu_share for both the users such that "root"'s cpu_share
-is twice "guest"'s cpu_share.
-
-When CONFIG_CGROUP_SCHED is defined, a "cpu.shares" file is created for each
+When CONFIG_FAIR_GROUP_SCHED is defined, a "cpu.shares" file is created for each
 group created using the pseudo filesystem.  See example steps below to create
 task groups and modify their CPU share using the "cgroups" pseudo filesystem.
 
@@ -273,24 +246,3 @@ task groups and modify their CPU share using the "cgroups" pseudo filesystem.
 
 	# #Launch gmplayer (or your favourite movie player)
 	# 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.
diff --git a/Documentation/scheduler/sched-rt-group.txt b/Documentation/scheduler/sched-rt-group.txt
index 86eabe6..605b0d4 100644
--- a/Documentation/scheduler/sched-rt-group.txt
+++ b/Documentation/scheduler/sched-rt-group.txt
@@ -126,23 +126,12 @@ priority!
 2.3 Basis for grouping tasks
 ----------------------------
 
-There are two compile-time settings for allocating CPU bandwidth. These are
-configured using the "Basis for grouping tasks" multiple choice menu under
-General setup > Group CPU Scheduler:
-
-a. CONFIG_USER_SCHED (aka "Basis for grouping tasks" =  "user id")
-
-This lets you use the virtual files under
-"/sys/kernel/uids/<uid>/cpu_rt_runtime_us" to control he CPU time reserved for
-each user .
-
-The other option is:
-
-.o CONFIG_CGROUP_SCHED (aka "Basis for grouping tasks" = "Control groups")
+Enabling CONFIG_RT_GROUP_SCHED lets you explicitly allocate real
+CPU bandwidth to task groups.
 
 This uses the /cgroup virtual file system and
 "/cgroup/<cgroup>/cpu.rt_runtime_us" to control the CPU time reserved for each
-control group instead.
+control group.
 
 For more information on working with control groups, you should read
 Documentation/cgroups/cgroups.txt as well.
@@ -161,8 +150,7 @@ For now, this can be simplified to just the following (but see Future plans):
 ===============
 
 There is work in progress to make the scheduling period for each group
-("/sys/kernel/uids/<uid>/cpu_rt_period_us" or
-"/cgroup/<cgroup>/cpu.rt_period_us" respectively) configurable as well.
+("/cgroup/<cgroup>/cpu.rt_period_us") configurable as well.
 
 The constraint on the period is that a subgroup must have a smaller or
 equal period to its parent. But realistically its not very useful _yet_

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-02 19:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24  5:17 [PATCH 1/2] sched: Remove remaining USER_SCHED code Li Zefan
2010-03-24  5:17 ` [PATCH 2/2] sched: Remove USER_SCHED from documentation Li Zefan
2010-03-24 14:35   ` Serge E. Hallyn
2010-04-02 19:11   ` [tip:sched/core] " tip-bot for Li Zefan
2010-03-26 15:51 ` [PATCH 1/2] sched: Remove remaining USER_SCHED code Dhaval Giani
2010-04-02 19:11 ` [tip:sched/core] " tip-bot for Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.