aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:06:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 12:06:17 -0400
commit8e4bc3dd2ca07d77882eba73cea240aba95a1854 (patch)
treeda105cd2c4f51c78c401c00d8b399572914694ed /kernel/sched.c
parentbd4c3a3441144cd46d1f544046523724c5bc6e94 (diff)
parent0d721ceadbeaa24d7f9dd41b3e5e29912327a7e1 (diff)
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched: Simplify sys_sched_rr_get_interval() system call sched: Fix potential NULL derference of doms_cur sched: Fix raciness in runqueue_is_locked() sched: Re-add lost cpu_allowed check to sched_fair.c::select_task_rq_fair() sched: Remove unneeded indentation in sched_fair.c::place_entity()
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index faf4d463bbff..830967e18285 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -681,15 +681,9 @@ inline void update_rq_clock(struct rq *rq)
681 * This interface allows printk to be called with the runqueue lock 681 * This interface allows printk to be called with the runqueue lock
682 * held and know whether or not it is OK to wake up the klogd. 682 * held and know whether or not it is OK to wake up the klogd.
683 */ 683 */
684int runqueue_is_locked(void) 684int runqueue_is_locked(int cpu)
685{ 685{
686 int cpu = get_cpu(); 686 return spin_is_locked(&cpu_rq(cpu)->lock);
687 struct rq *rq = cpu_rq(cpu);
688 int ret;
689
690 ret = spin_is_locked(&rq->lock);
691 put_cpu();
692 return ret;
693} 687}
694 688
695/* 689/*
@@ -6825,23 +6819,8 @@ SYSCALL_DEFINE2(sched_rr_get_interval, pid_t, pid,
6825 if (retval) 6819 if (retval)
6826 goto out_unlock; 6820 goto out_unlock;
6827 6821
6828 /* 6822 time_slice = p->sched_class->get_rr_interval(p);
6829 * Time slice is 0 for SCHED_FIFO tasks and for SCHED_OTHER
6830 * tasks that are on an otherwise idle runqueue:
6831 */
6832 time_slice = 0;
6833 if (p->policy == SCHED_RR) {
6834 time_slice = DEF_TIMESLICE;
6835 } else if (p->policy != SCHED_FIFO) {
6836 struct sched_entity *se = &p->se;
6837 unsigned long flags;
6838 struct rq *rq;
6839 6823
6840 rq = task_rq_lock(p, &flags);
6841 if (rq->cfs.load.weight)
6842 time_slice = NS_TO_JIFFIES(sched_slice(&rq->cfs, se));
6843 task_rq_unlock(rq, &flags);
6844 }
6845 read_unlock(&tasklist_lock); 6824 read_unlock(&tasklist_lock);
6846 jiffies_to_timespec(time_slice, &t); 6825 jiffies_to_timespec(time_slice, &t);
6847 retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0; 6826 retval = copy_to_user(interval, &t, sizeof(t)) ? -EFAULT : 0;
@@ -9171,6 +9150,7 @@ void __init sched_init_smp(void)
9171 cpumask_var_t non_isolated_cpus; 9150 cpumask_var_t non_isolated_cpus;
9172 9151
9173 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); 9152 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL);
9153 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);
9174 9154
9175#if defined(CONFIG_NUMA) 9155#if defined(CONFIG_NUMA)
9176 sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **), 9156 sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
@@ -9202,7 +9182,6 @@ void __init sched_init_smp(void)
9202 sched_init_granularity(); 9182 sched_init_granularity();
9203 free_cpumask_var(non_isolated_cpus); 9183 free_cpumask_var(non_isolated_cpus);
9204 9184
9205 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);
9206 init_sched_rt_class(); 9185 init_sched_rt_class();
9207} 9186}
9208#else 9187#else