Re: [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()

From: David Rientjes
Date: Mon Feb 21 2011 - 19:25:32 EST


On Mon, 21 Feb 2011, Li Zefan wrote:

> Unfortunately, as I looked into the code again I found cpuset_change_nodemask()
> is called by other functions that use the global cpuset_mems, so I
> think we'd better check the refcnt of cpuset_mems.
>
> How about this:
>
> [PATCH 3/4] cpuset: Fix unchecked calls to NODEMASK_ALLOC()
>
> Those functions that use NODEMASK_ALLOC() can't propogate errno
> to users, so might fail silently.
>
> Based on the fact that all of them are called with cgroup_mutex
> held, we fix this by using a global nodemask.
>

If all of the functions that require a nodemask are protected by
cgroup_mutex, then I think it would be much better to just statically
allocate them within the function and avoid any nodemask in file scope.
cpuset_mems cannot be shared so introducing it with a refcount would
probably just be confusing.
--
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/