[PATCH 5/6] core: use cpumask_copy instead of = for cpus_allowed in fork

Yinghai Lu
2009-06-06T21:56:22Z

so later could use nr_cpumask_bits in cpumask_size when MAXSMP is used

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
arch/x86/kernel/cpu/cpufreq/powernow-k8.c | 52 ++++++++++++++++++++----------
kernel/fork.c | 2 -
2 files changed, 36 insertions(+), 18 deletions(-)

Index: linux-2.6/kernel/fork.c
===================================================================
--- linux-2.6.orig/kernel/fork.c
+++ linux-2.6/kernel/fork.c
@@ -1207,7 +1207,7 @@ static struct task_struct *copy_process(
* to ensure it is on a valid CPU (and if not, just force it back to
* parent's CPU). This avoids alot of nasty races.
*/
- p->cpus_allowed = current->cpus_allowed;
+ cpumask_copy(&p->cpus_allowed, &current->cpus_allowed);
p->rt.nr_cpus_allowed = current->rt.nr_cpus_allowed;
if (unlikely(!cpu_isset(task_cpu(p), p->cpus_allowed) ||
!cpu_online(task_cpu(p))))