• Rusty Russell's avatar
    [PATCH] More care in sys_setaffinity · 7cd3f199
    Rusty Russell authored
    We currently mask off offline CPUs in both set_cpus_allowed and
    sys_sched_setaffinity.  This is firstly redundant, and secondly
    erroneous when more CPUs come online (eg. setting affinity to all 1s
    should mean all CPUs, including future ones).
    
    We mask with cpu_online_map() in sys_sched_getaffinity *anyway* (which
    is another issue, since this is not valid with changing of online
    cpus either), so userspace won't see any difference.
    
    This patch makes set_cpus_allowed() return -errno, and check that in
    sys_sched_setaffinity.
    7cd3f199
sched.h 25.6 KB