Re: [PATCH] Cpuset: remove unnecessary NULL check

From: Eric W. Biederman
Date: Sun Mar 19 2006 - 09:06:55 EST


Paul Jackson <pj@xxxxxxx> writes:

> From: Paul Jackson <pj@xxxxxxx>
>
> Remove a no longer needed test for NULL cpuset pointer, with
> a little comment explaining why the test isn't needed.

Could we make that comment a little more explicit. Say:

No need to check that tsk->cpuset != NULL, since cpuset_exit() sets
it to top_cpuset instead.

Comments that refer to a nebulous hack in some other function
a little hard to understand when new, and get really confusing
when the other function changes and it isn't clear what aspect
of that other function the comment depended on and if that property
still exists.

> * - No need to task_lock(tsk) on this tsk->cpuset reference, as it
> * doesn't really matter if tsk->cpuset changes after we read it,
> * and we take manage_mutex, keeping attach_task() from changing it
> - * anyway.
> + * anyway. No need to check that tsk->cpuset != NULL, thanks to the
> + * cpuset_exit() Hack.
> */


Eric
-
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/