Messages in this thread Patch in this message | | | Date | Wed, 9 Jun 2004 15:55:10 -0700 | From | Paul Jackson <> | Subject | Re: [PATCH][2.6.7-rc3-mm1] perfctr cpumask cleanup |
| |
Or ... pushing the point further ... one _could_ remove the old_mask as well. However I think this makes the code less clear, even if it does save a stack copy of a cpumask_t. So I'm of mixed feelings on this patch, edging slightly toward negative. Same utter lack of testing as the previous patch.
Signed-off-by: Paul Jackson <pj@sgi.com>
Index: 2.6.7-rc3-mm1/drivers/perfctr/virtual.c =================================================================== --- 2.6.7-rc3-mm1.orig/drivers/perfctr/virtual.c 2004-06-09 15:38:32.000000000 -0700 +++ 2.6.7-rc3-mm1/drivers/perfctr/virtual.c 2004-06-09 15:53:06.000000000 -0700 @@ -403,14 +403,14 @@ return -EFAULT; if (control.cpu_control.nractrs || control.cpu_control.nrictrs) { - cpumask_t old_mask, new_mask; + cpumask_t new_mask; - old_mask = tsk->cpus_allowed; - cpus_andnot(new_mask, old_mask, perfctr_cpus_forbidden_mask); + cpus_andnot(new_mask, tsk->cpus_allowed, + perfctr_cpus_forbidden_mask); if (cpus_empty(new_mask)) return -EINVAL; - if (!cpus_equal(new_mask, old_mask)) + if (!cpus_equal(tsk->cpus_allowed, new_mask)) set_cpus_allowed(tsk, new_mask); }
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.650.933.1373 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |