Re: [patch 1/1] export cpu_online_map
From: Herbert Xu
Date: Thu Oct 27 2005 - 21:49:43 EST
akpm@xxxxxxxx wrote:
>
> - Why isn't set_cpus_allowed() just a no-op on UP? Or some trivial thing
> which tests for cpu #0?
It's still needed to weed out bogus masks that have CPU 0 turned off.
You're right that it doesn't need to check cpu_online_map though.
Here is a patch to make it check for CPU 0 instead.
Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/include/linux/sched.h b/include/linux/sched.h
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -895,7 +895,7 @@ extern int set_cpus_allowed(task_t *p, c
#else
static inline int set_cpus_allowed(task_t *p, cpumask_t new_mask)
{
- if (!cpus_intersects(new_mask, cpu_online_map))
+ if (!cpu_isset(0, new_mask))
return -EINVAL;
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/