From 35f6529e79df5da2f01f5ab01bb5af9a9ba82a78 Mon Sep 17 00:00:00 2001 From: Yong Zhang Date: Mon, 9 May 2011 22:07:05 +0800 Subject: [PATCH] --- yaml --- r: 245605 b: refs/heads/master c: db44fc017d5989302713ab4e7f9e922b648f4b59 h: refs/heads/master i: 245603: 7312cd2dbd8d946d7ca5e008a4c5aa0d558508cc v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 36c4986c441c..74da41c857fd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 61eadef6a9bde9ea62fda724a9cb501ce9bc925a +refs/heads/master: db44fc017d5989302713ab4e7f9e922b648f4b59 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index b8b9a7dac9b0..70bec4f1edbb 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5946,13 +5946,15 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask) rq = task_rq_lock(p, &flags); + if (cpumask_equal(&p->cpus_allowed, new_mask)) + goto out; + if (!cpumask_intersects(new_mask, cpu_active_mask)) { ret = -EINVAL; goto out; } - if (unlikely((p->flags & PF_THREAD_BOUND) && p != current && - !cpumask_equal(&p->cpus_allowed, new_mask))) { + if (unlikely((p->flags & PF_THREAD_BOUND) && p != current)) { ret = -EINVAL; goto out; }