Skip to content

Commit f66ffde

Browse files
committed
Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (25 commits) sched: Fix SCHED_MC regression caused by change in sched cpu_power sched: Don't use possibly stale sched_class kthread, sched: Remove reference to kthread_create_on_cpu sched: cpuacct: Use bigger percpu counter batch values for stats counters percpu_counter: Make __percpu_counter_add an inline function on UP sched: Remove member rt_se from struct rt_rq sched: Change usage of rt_rq->rt_se to rt_rq->tg->rt_se[cpu] sched: Remove unused update_shares_locked() sched: Use for_each_bit sched: Queue a deboosted task to the head of the RT prio queue sched: Implement head queueing for sched_rt sched: Extend enqueue_task to allow head queueing sched: Remove USER_SCHED sched: Fix the place where group powers are updated sched: Assume *balance is valid sched: Remove load_balance_newidle() sched: Unify load_balance{,_newidle}() sched: Add a lock break for PREEMPT=y sched: Remove from fwd decls sched: Remove rq_iterator from move_one_task ... Fix up trivial conflicts in kernel/sched.c
2 parents 2531216 + dd5feea commit f66ffde

14 files changed

Lines changed: 1976 additions & 2682 deletions

File tree

Documentation/feature-removal-schedule.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@ be removed from this file.
66

77
---------------------------
88

9-
What: USER_SCHED
10-
When: 2.6.34
11-
12-
Why: USER_SCHED was implemented as a proof of concept for group scheduling.
13-
The effect of USER_SCHED can already be achieved from userspace with
14-
the help of libcgroup. The removal of USER_SCHED will also simplify
15-
the scheduler code with the removal of one major ifdef. There are also
16-
issues USER_SCHED has with USER_NS. A decision was taken not to fix
17-
those and instead remove USER_SCHED. Also new group scheduling
18-
features will not be implemented for USER_SCHED.
19-
20-
Who: Dhaval Giani <dhaval@linux.vnet.ibm.com>
21-
22-
---------------------------
23-
249
What: PRISM54
2510
When: 2.6.34
2611

include/linux/kernel.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ extern int _cond_resched(void);
124124
#endif
125125

126126
#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
127-
void __might_sleep(char *file, int line, int preempt_offset);
127+
void __might_sleep(const char *file, int line, int preempt_offset);
128128
/**
129129
* might_sleep - annotation for functions that can sleep
130130
*
@@ -138,7 +138,8 @@ extern int _cond_resched(void);
138138
# define might_sleep() \
139139
do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0)
140140
#else
141-
static inline void __might_sleep(char *file, int line, int preempt_offset) { }
141+
static inline void __might_sleep(const char *file, int line,
142+
int preempt_offset) { }
142143
# define might_sleep() do { might_resched(); } while (0)
143144
#endif
144145

include/linux/percpu_counter.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount)
9898
fbc->count = amount;
9999
}
100100

101-
#define __percpu_counter_add(fbc, amount, batch) \
102-
percpu_counter_add(fbc, amount)
103-
104101
static inline void
105102
percpu_counter_add(struct percpu_counter *fbc, s64 amount)
106103
{
@@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount)
109106
preempt_enable();
110107
}
111108

109+
static inline void
110+
__percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
111+
{
112+
percpu_counter_add(fbc, amount);
113+
}
114+
112115
static inline s64 percpu_counter_read(struct percpu_counter *fbc)
113116
{
114117
return fbc->count;

include/linux/sched.h

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,6 @@ struct user_struct {
740740
uid_t uid;
741741
struct user_namespace *user_ns;
742742

743-
#ifdef CONFIG_USER_SCHED
744-
struct task_group *tg;
745-
#ifdef CONFIG_SYSFS
746-
struct kobject kobj;
747-
struct delayed_work work;
748-
#endif
749-
#endif
750-
751743
#ifdef CONFIG_PERF_EVENTS
752744
atomic_long_t locked_vm;
753745
#endif
@@ -1087,7 +1079,8 @@ struct sched_domain;
10871079
struct sched_class {
10881080
const struct sched_class *next;
10891081

1090-
void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup);
1082+
void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup,
1083+
bool head);
10911084
void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
10921085
void (*yield_task) (struct rq *rq);
10931086

@@ -1099,14 +1092,6 @@ struct sched_class {
10991092
#ifdef CONFIG_SMP
11001093
int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
11011094

1102-
unsigned long (*load_balance) (struct rq *this_rq, int this_cpu,
1103-
struct rq *busiest, unsigned long max_load_move,
1104-
struct sched_domain *sd, enum cpu_idle_type idle,
1105-
int *all_pinned, int *this_best_prio);
1106-
1107-
int (*move_one_task) (struct rq *this_rq, int this_cpu,
1108-
struct rq *busiest, struct sched_domain *sd,
1109-
enum cpu_idle_type idle);
11101095
void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
11111096
void (*post_schedule) (struct rq *this_rq);
11121097
void (*task_waking) (struct rq *this_rq, struct task_struct *task);
@@ -2520,13 +2505,9 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
25202505

25212506
extern void normalize_rt_tasks(void);
25222507

2523-
#ifdef CONFIG_GROUP_SCHED
2508+
#ifdef CONFIG_CGROUP_SCHED
25242509

25252510
extern struct task_group init_task_group;
2526-
#ifdef CONFIG_USER_SCHED
2527-
extern struct task_group root_task_group;
2528-
extern void set_tg_uid(struct user_struct *user);
2529-
#endif
25302511

25312512
extern struct task_group *sched_create_group(struct task_group *parent);
25322513
extern void sched_destroy_group(struct task_group *tg);

init/Kconfig

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -461,57 +461,6 @@ config LOG_BUF_SHIFT
461461
config HAVE_UNSTABLE_SCHED_CLOCK
462462
bool
463463

464-
config GROUP_SCHED
465-
bool "Group CPU scheduler"
466-
depends on EXPERIMENTAL
467-
default n
468-
help
469-
This feature lets CPU scheduler recognize task groups and control CPU
470-
bandwidth allocation to such task groups.
471-
In order to create a group from arbitrary set of processes, use
472-
CONFIG_CGROUPS. (See Control Group support.)
473-
474-
config FAIR_GROUP_SCHED
475-
bool "Group scheduling for SCHED_OTHER"
476-
depends on GROUP_SCHED
477-
default GROUP_SCHED
478-
479-
config RT_GROUP_SCHED
480-
bool "Group scheduling for SCHED_RR/FIFO"
481-
depends on EXPERIMENTAL
482-
depends on GROUP_SCHED
483-
default n
484-
help
485-
This feature lets you explicitly allocate real CPU bandwidth
486-
to users or control groups (depending on the "Basis for grouping tasks"
487-
setting below. If enabled, it will also make it impossible to
488-
schedule realtime tasks for non-root users until you allocate
489-
realtime bandwidth for them.
490-
See Documentation/scheduler/sched-rt-group.txt for more information.
491-
492-
choice
493-
depends on GROUP_SCHED
494-
prompt "Basis for grouping tasks"
495-
default USER_SCHED
496-
497-
config USER_SCHED
498-
bool "user id"
499-
help
500-
This option will choose userid as the basis for grouping
501-
tasks, thus providing equal CPU bandwidth to each user.
502-
503-
config CGROUP_SCHED
504-
bool "Control groups"
505-
depends on CGROUPS
506-
help
507-
This option allows you to create arbitrary task groups
508-
using the "cgroup" pseudo filesystem and control
509-
the cpu bandwidth allocated to each such task group.
510-
Refer to Documentation/cgroups/cgroups.txt for more
511-
information on "cgroup" pseudo filesystem.
512-
513-
endchoice
514-
515464
menuconfig CGROUPS
516465
boolean "Control Group support"
517466
help
@@ -632,6 +581,36 @@ config CGROUP_MEM_RES_CTLR_SWAP
632581
Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
633582
size is 4096bytes, 512k per 1Gbytes of swap.
634583

584+
menuconfig CGROUP_SCHED
585+
bool "Group CPU scheduler"
586+
depends on EXPERIMENTAL && CGROUPS
587+
default n
588+
help
589+
This feature lets CPU scheduler recognize task groups and control CPU
590+
bandwidth allocation to such task groups. It uses cgroups to group
591+
tasks.
592+
593+
if CGROUP_SCHED
594+
config FAIR_GROUP_SCHED
595+
bool "Group scheduling for SCHED_OTHER"
596+
depends on CGROUP_SCHED
597+
default CGROUP_SCHED
598+
599+
config RT_GROUP_SCHED
600+
bool "Group scheduling for SCHED_RR/FIFO"
601+
depends on EXPERIMENTAL
602+
depends on CGROUP_SCHED
603+
default n
604+
help
605+
This feature lets you explicitly allocate real CPU bandwidth
606+
to users or control groups (depending on the "Basis for grouping tasks"
607+
setting below. If enabled, it will also make it impossible to
608+
schedule realtime tasks for non-root users until you allocate
609+
realtime bandwidth for them.
610+
See Documentation/scheduler/sched-rt-group.txt for more information.
611+
612+
endif #CGROUP_SCHED
613+
635614
endif # CGROUPS
636615

637616
config MM_OWNER

kernel/ksysfs.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,8 @@ static int __init ksysfs_init(void)
197197
goto group_exit;
198198
}
199199

200-
/* create the /sys/kernel/uids/ directory */
201-
error = uids_sysfs_init();
202-
if (error)
203-
goto notes_exit;
204-
205200
return 0;
206201

207-
notes_exit:
208-
if (notes_size > 0)
209-
sysfs_remove_bin_file(kernel_kobj, &notes_attr);
210202
group_exit:
211203
sysfs_remove_group(kernel_kobj, &kernel_attr_group);
212204
kset_exit:

kernel/kthread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static void create_kthread(struct kthread_create_info *create)
101101
*
102102
* Description: This helper function creates and names a kernel
103103
* thread. The thread will be stopped: use wake_up_process() to start
104-
* it. See also kthread_run(), kthread_create_on_cpu().
104+
* it. See also kthread_run().
105105
*
106106
* When woken, the thread will run @threadfn() with @data as its
107107
* argument. @threadfn() can either call do_exit() directly if it is a

0 commit comments

Comments
 (0)